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

5 lines
155 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
;; 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 ])