gscheme/examples/tail-recursion.scm

8 lines
111 B
Scheme
Raw Normal View History

2022-08-05 05:28:40 -04:00
(define tailrec
(lambda (n)
(display n) (newline)
(if (= n 0) '()
(tailrec (- n 1)))))
(tailrec 5)