RosettaCodeData/Task/Accumulator-factory/PascalABC.NET/accumulator-factory.pas

13 lines
154 B
ObjectPascal
Raw Permalink Normal View History

2024-07-13 15:19:22 -07:00
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.