diff options
author | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-06 01:05:21 +0200 |
---|---|---|
committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2025-01-06 01:05:57 +0200 |
commit | 89bac537165bf262594cca343cb45e16a2167145 (patch) | |
tree | f72a80f1624b12fa3b27c6dc6feedc3e06594e20 /examples/fib.fwd | |
parent | aec19e55ca32f68536a550f100d3f058b8a93c02 (diff) | |
download | fwd-89bac537165bf262594cca343cb45e16a2167145.tar.gz fwd-89bac537165bf262594cca343cb45e16a2167145.zip |
implement move checking furthermvcheck
+ Enough that examples still compile, but missing references etc.
Diffstat (limited to 'examples/fib.fwd')
-rw-r--r-- | examples/fib.fwd | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/fib.fwd b/examples/fib.fwd index be2b63f..e5014af 100644 --- a/examples/fib.fwd +++ b/examples/fib.fwd @@ -5,17 +5,19 @@ fib(int n, (int) res) { - if n < 2 { + fwd_copy(n) => int n1, int n2; + if n1 < 2 { res(1); } else { - fib(n - 1) => int f1; - fib(n - 2) => int f2; + fib(n2 - 1) => int f1; + fib(n2 - 2) => int f2; res(f1 + f2); } } /* 'extern' println */ -fwd_println(int n); +fwd_println(auto n); +fwd_copy(auto n, (auto, auto) n1); main() { |