RosettaCodeData/Task/Closures-Value-capture/AppleScript/closures-value-capture-1.applescript
2017-09-25 22:28:19 +02:00

17 lines
252 B
AppleScript

on run
set fns to {}
repeat with i from 1 to 10
set end of fns to closure(i)
end repeat
|λ|() of item 3 of fns
end run
on closure(x)
script
on |λ|()
x * x
end |λ|
end script
end closure