Closures/Value capture: Difference between revisions
Content added Content deleted
Line 832: | Line 832: | ||
=={{header|Oforth}}== |
=={{header|Oforth}}== |
||
<lang Oforth>func: newClosure(i) { #[ "I am block number " |
<lang Oforth>func: newClosure(i) { | j | i sq ->j #[ "I am block number " j + println ] } |
||
10 seq map(#newClosure) at(7) perform</lang> |
10 seq map(#newClosure) at(7) perform</lang> |
||