Accumulator factory: Difference between revisions

Content added Content deleted
(added RPL)
 
Line 2,803: Line 2,803:
gp > print(y(1/3));
gp > print(y(1/3));
13/3</pre>
13/3</pre>

=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
function foo(n: real): real -> real :=
i -> begin
n += i;
Result := n;
end;

begin
var x := foo(1);
x(5);
foo(3);
print(x(2.3));
end.
</syntaxhighlight>

{{out}}
<pre>
8.3
</pre>



=={{header|Perl}}==
=={{header|Perl}}==