Accumulator factory: Difference between revisions

m
(add Mercury)
Line 2,719:
=={{header|Retro}}==
Retro only supports integers.
<lang Retro> : acc here swap , [ &+! &@ bi ] curry ;
 
( create an accumulator function )
1 acc
 
( and give it a name )
constant x
 
( add values to it and display the results )
5 x do putn
2 x do putn</lang>
 
 
RETRO 12, 2018.4
 
<lang Retro>:acc (ns-)
Anonymous user