Closures/Value capture: Difference between revisions

Content added Content deleted
m (fix markup)
m (fix markup)
Line 1,504: Line 1,504:


A dictionary based approach may prove somewhat easier:
A dictionary based approach may prove somewhat easier:
<!--<syntaxhighlight lang="Phix">(phixonline)-->
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">square</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">tid</span><span style="color: #0000FF;">)</span>
<span style="color: #008080;">function</span> <span style="color: #000000;">square</span><span style="color: #0000FF;">(</span><span style="color: #004080;">integer</span> <span style="color: #000000;">tid</span><span style="color: #0000FF;">)</span>
Line 1,522: Line 1,522:
same output, for both tests
same output, for both tests
=={{header|Phixmonti}}==
=={{header|Phixmonti}}==
<syntaxhighlight lang="Phixmonti">def power2
<syntaxhighlight lang="phixmonti">def power2
dup *
dup *
enddef
enddef