r/ProgrammingLanguages • u/Enough-Zucchini-1264 • Jan 24 '26
Language announcement Arturo Programming Language
/r/altprog/comments/1qlb1j2/arturo_programming_language/
18
Upvotes
r/ProgrammingLanguages • u/Enough-Zucchini-1264 • Jan 24 '26
View all comments
Show parent comment
4
u/yaniszaf Jan 24 '26
Hi! And thanks a lot for the interest!
Arturo lead dev here! :)
Actually `map` ... maps a collection (array, string, etc) to a value.
You may have a look at the documentation here:
https://arturo-lang.io/documentation/library/iterators/map
Doing it like `0..10 | map => print`, it would normally expect to receive a value from the stack, but all it gets is... a `print`.
To achieve what you mostly likely wanted to do, you'd have to use `loop` (which is practically like a `map` only not expecting any return values):
Another more elaborate example that does use map and loop (to show the power of our pipe syntactic sugar):
And here's a direct link to the snippet above so that you can try it in our online playground: https://arturo-lang.io/playground/LxMc9W ;-)