RosettaCodeData/Task/Apply-a-callback-to-an-array/NetLogo/apply-a-callback-to-an-arra...

5 lines
155 B
Plaintext

;; NetLogo “anonymous procedures”
;; stored in a variable, just to show it can be done.
let callback [ [ x ] x * x ]
show (map callback [ 1 2 3 4 5 ])