Accumulator factory: Difference between revisions
Added Wren
(Create x86 Assembly entry for "Accumulator factory") |
(Added Wren) |
||
Line 3,321:
(a)
=> 6</pre>
=={{header|Wren}}==
<lang ecmascript>var accumulator = Fn.new { |acc| Fn.new { |n| acc = acc + n } }
var x = accumulator.call(1)
x.call(5)
accumulator.call(3)
System.print(x.call(2.3))</lang>
{{out}}
<pre>
8.3
</pre>
=={{header|x86 Assembly}}==
|