Closures/Value capture: Difference between revisions
Content added Content deleted
Line 549: | Line 549: | ||
=={{header|Elena}}== |
=={{header|Elena}}== |
||
ELENA 3.x : |
|||
⚫ | |||
<lang elena>#import system'routines. |
|||
program = |
|||
console writeLine:(list@3 eval).</lang> |
|||
[ |
|||
⚫ | |||
functions run &each: (:func) [ console writeLine:(func eval). ]. |
|||
].</lang> |
|||
{{out}} |
{{out}} |
||
<pre> |
<pre>0 |
||
1 |
|||
4 |
|||
9 |
|||
16 |
|||
25 |
|||
36 |
|||
49 |
|||
64 |
|||
81</pre> |
|||
=={{header|Elixir}}== |
=={{header|Elixir}}== |