diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-05-01 22:43:13 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2026-05-01 22:43:13 +0300 |
| commit | db3809488805fbdcd9d726d9ed45ad7335812bd1 (patch) | |
| tree | dcf1ceb68a7d77733a474825a9804fe99d253b48 /examples/fib.fwd | |
| parent | f1e9860ab638594e95db0ada848157b860eeb831 (diff) | |
| download | fwd-db3809488805fbdcd9d726d9ed45ad7335812bd1.tar.gz fwd-db3809488805fbdcd9d726d9ed45ad7335812bd1.zip | |
+ Might come up with proper examples at some point, but for now tests at
least tell us if they're broken
Diffstat (limited to 'examples/fib.fwd')
| -rw-r--r-- | examples/fib.fwd | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/examples/fib.fwd b/examples/fib.fwd deleted file mode 100644 index 4583a26..0000000 --- a/examples/fib.fwd +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Currently the compilation process requires a bit of manual intervention. - * For this particular example, run something like this from the root dir: - * - * ./fwd examples/fib.fwd > /tmp/fib.c - * gcc -Lmod -Iinclude -Ilib -Wl,-rpath=mod -O2 /tmp/fib.c -lfwdio -o /tmp/fib - * /tmp/fib - * - */ - -/* modules are just libraries that can be loaded at runtime */ -import "../mod/libfwdio.so" - -fib(i64 n, (i64) res) -{ - if n < 2 { - res(1); - } else { - fib(n - 1) => i64 f1; - fib(n - 2) => i64 f2; - res(f1 + f2); - } -} - -main() -{ - fib(42) => i64 n; - fwdprint_i64(n); - fwdprint_nl(); -} |
