Anonymous user
Accumulator factory: Difference between revisions
m
Fixed alphabetic position
(Added PicoLisp) |
m (Fixed alphabetic position) |
||
Line 245:
}
8.3</pre>
=={{header|PicoLisp}}==▼
<lang PicoLisp>(de accumulator (Sum)▼
(curry (Sum)▼
(N) (inc 'Sum N) ) )▼
(def 'a (accumulator 7))▼
(a 1) # Output: -> 8▼
(a 2) # Output: -> 10▼
(a -5) # Output: -> 5</lang>▼
=={{header|OCaml}}==
Line 329 ⟶ 319:
$a(4.5);
say $a(.5); # Prints "10".</lang>
▲=={{header|PicoLisp}}==
▲<lang PicoLisp>(de accumulator (Sum)
▲ (curry (Sum)
▲ (N) (inc 'Sum N) ) )
▲(def 'a (accumulator 7))
▲(a 1) # Output: -> 8
▲(a 2) # Output: -> 10
▲(a -5) # Output: -> 5</lang>
=={{header|Python}}==
|