ginger/examples/fib.gg

20 lines
293 B
Plaintext
Raw Normal View History

2021-12-30 22:29:38 +00:00
out = {
decr = { out = add < (in; -1;); };
n = tupEl < (in; 0;);
a = tupEl < (in; 1;);
b = tupEl < (in; 2;);
out = if < (
isZero < n;
a;
recur < (
decr < n;
b;
add < (a;b;);
);
);
} < (in; 0; 1;);