Closures/Value capture: Difference between revisions
Content added Content deleted
Line 550: | Line 550: | ||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA 3. |
ELENA 3.4 : |
||
<lang elena>import system'routines. |
<lang elena>import system'routines. |
||
program = |
public program = |
||
[ |
[ |
||
var functions := Array new |
var functions := Array new(10); populate(:i)<int>( [ ^ i * i ] ). |
||
functions forEach(:func) [ console writeLine(func()). ]. |
functions forEach(:func) [ console writeLine(func()). ]. |