chibi-scheme/tests/basic/test06-letrec.scm
Alex Shinn b1c0ea895b committing initial bignum support, still needs more thorough testing.
can disable with USE_BIGNUMS=0 - the interactions between this and
USE_FLONUMS are messy, so they will likely be merged into a single
option in the near future (i.e. you either have only fixnums, or a
full range of numeric types).
adding rationals based on this would be easy and is a likely future
feature.  adding native support for complex numbers is unlikely.
2009-07-07 19:16:23 +09:00

15 lines
310 B
Scheme

(letrec ((add (lambda (a b) (+ a b))))
(write (add 3 4))
(newline))
(letrec ((even? (lambda (n) (if (zero? n) #t (odd? (- n 1)))))
(odd? (lambda (n) (if (zero? n) #f (even? (- n 1))))))
(write (even? 1000))
(newline)
(write (even? 1001))
(newline)
(write (odd? 1000))
(newline)
)