-
-
Notifications
You must be signed in to change notification settings - Fork 4
iteration
pannous edited this page Sep 19, 2021
·
4 revisions
Iteration is often implicit since all functions are automatically broadcasting on lists and pair values:
square number=number*number
square [1 2 3] == [1 4 9]
square [a:1 b:2 c:3] == [a:1 b:4 c:9]
delete file = run `rm $file.name`
delete files in ls / # 🧐
The all keyword takes a block making it a functor similar to map:
all files{delete it}
It should be superfluous in may situations:
print characters in "hello"