RosettaCodeData/Task/Apply-a-callback-to-an-array/Logo/apply-a-callback-to-an-array.logo
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

6 lines
192 B
Text

to square :x
output :x * :x
end
show map "square [1 2 3 4 5] ; [1 4 9 16 25]
show map [? * ?] [1 2 3 4 5] ; [1 4 9 16 25]
foreach [1 2 3 4 5] [print square ?] ; 1 4 9 16 25, one per line