Closures/Value capture: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (fix markup) |
Drkameleon (talk | contribs) (added Arturo) |
||
Line 170: | Line 170: | ||
{{Out}} |
{{Out}} |
||
<pre>9</pre> |
<pre>9</pre> |
||
=={{header|Arturo}}== |
|||
<syntaxhighlight lang="arturo">funcs: [ø] |
|||
loop 1..10 'f -> |
|||
'funcs ++ function [] with 'f [ |
|||
f * f |
|||
] |
|||
print call funcs\3 []</syntaxhighlight> |
|||
{{out}} |
|||
<pre>9</pre> |
|||
=={{header|Axiom}}== |
=={{header|Axiom}}== |
||
Using the Spad compiler: |
Using the Spad compiler: |
||
Line 184: | Line 198: | ||
<syntaxhighlight lang="Axiom">[1,4,9,16,25,36,49,64,81,100] |
<syntaxhighlight lang="Axiom">[1,4,9,16,25,36,49,64,81,100] |
||
Type: List(Integer)</syntaxhighlight> |
Type: List(Integer)</syntaxhighlight> |
||
=={{header|Babel}}== |
=={{header|Babel}}== |
||