Anonymous user
Closures/Value capture: Difference between revisions
m
→{{header|Elena}}
m (→{{header|Wren}}: Changed to Wren S/H) |
imported>Arakov |
||
Line 649:
</syntaxhighlight>
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import system'routines;
import extensions;
Line 655:
public program()
{
var functions := Array.allocate(10).populate::(int i => { ^ i * i} );
functions.forEach::(func) { console.printLine(func()) }
}</syntaxhighlight>
{{out}}
|