add tail-call test
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
(import (scheme base))
|
||||
|
||||
;;; always returns zero
|
||||
(define (zero n)
|
||||
(if (zero? n)
|
||||
0
|
||||
(zero (- n 1))))
|
||||
|
||||
;;; using apply
|
||||
(define (zero-2 n)
|
||||
(if (zero? n)
|
||||
0
|
||||
(apply zero-2 (list (- n 1)))))
|
||||
Reference in New Issue
Block a user