; RUN: run.py %s | filecheck %s (let ([nil (lam (c n) (n))] [cons (lam (x y) (lam (c n) (c x y)))] [head true] [fix (lam (f) (let ([t (lam (x) (f (lam (v) (x x v))))]) (t t)))] [if (lam (c t f) ((c t f)))]) ([fix (lam (recur a b l n) (if (<= n 0) [lam () (let [(_ (debug 0))] l)] [lam () (recur b (+ (debug a) b) (cons a l) (- n 1))]))] 0 1 nil 30)) ; check: 0 ; nextln: 1 ; nextln: 1 ; nextln: 2 ; nextln: 3 ; nextln: 5 ; nextln: 8 ; nextln: 13 ; nextln: 21 ; nextln: 34 ; nextln: 55 ; nextln: 89 ; nextln: 144 ; nextln: 233 ; nextln: 377 ; nextln: 610 ; nextln: 987 ; nextln: 1597 ; nextln: 2584 ; nextln: 4181 ; nextln: 6765 ; nextln: 10946 ; nextln: 17711 ; nextln: 28657 ; nextln: 46368 ; nextln: 75025 ; nextln: 121393 ; nextln: 196418 ; nextln: 317811 ; nextln: 514229 ; nextln: 0