In TSPL 3.2 we find:
(letrec ((even?
(lambda (x)
(or (= x 0)
(odd? (- x 1)))))
(odd?
(lambda (x)
(and (not (= x 0))
(even? (- x 1))))))
;; (list (even? 20) (odd? 20))) => (#t #f)
but the same program, if use let
instead of letrec
, still can run in ChezScheme:
(let ((even?
(lambda (x)
(or (= x 0)
(odd? (- x 1)))))
(odd?
(lambda (x)
(and (not (= x 0))
(even? (- x 1))))))
Is it a Chez's bug? TSPL can't be wrong. Thanks!