diff options
Diffstat (limited to 'examples/fib.fwd')
-rw-r--r-- | examples/fib.fwd | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/fib.fwd b/examples/fib.fwd index 8b0e055..4eb2e60 100644 --- a/examples/fib.fwd +++ b/examples/fib.fwd @@ -5,19 +5,19 @@ * bifurcating nature of fibonacci just gets mapped to a linear sequence of * calls? */ -fib(n, res) +fib(int n, (int) res) { - fwd_if(n < 2) => { + if n < 2 { res(1); - } => { - fib(n - 1) => f1; - fib(n - 2) => f2; + } else { + fib(n - 1) => int f1; + fib(n - 2) => int f2; res(f1 + f2); } } main() { - fib(6) => n; + fib(6) => int n; fwd_println(n); } |