/* fib.q: Fibonacci function (tail-recursive version) */ private fib2; fib N = fib2 1 0 N; fib2 A B N = fib2 (A+B) A (N-1) if N>0; = B otherwise;