summaryrefslogtreecommitdiff
path: root/tests/mutual-recursion.lisp
blob: 4c054ea3a52bfe83e2f9a57647299f78b72bce4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "stdlib.lisp"

(declare g)

(define f (n)
    (do
        (print (concat "f " (number->string n)))
        (if (>= n 100) n (g (* 2 n)))))

(define g (n)
    (do
        (print (concat "g " (number->string n)))
        (if (>= n 100) n (f (+ n 1)))))

(print (f 1))