Jump to content

Accumulator factory: Difference between revisions

adding lambdatalk
No edit summary
(adding lambdatalk)
Line 1,721:
8
</pre>
 
=={{header|Lambdatalk}}==
Lambdatlk is a functional programming language without closures but with mutable arrays.
<lang scheme>
{def acc
{def acc.mem {A.new 0}}
{lambda {:n}
{+ {A.toS {A.addlast! :n {acc.mem}}}}} }
-> acc
 
{acc 1} -> 1
{acc 5} -> 6
{acc 2.3} -> 8.3
</lang>
 
=={{header|LFE}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.