15 lines
312 B
Plaintext
Raw Permalink Normal View History

2022-04-07 18:43:21 +02:00
;; In Emacs, open this file in -*- Scheme -*- mode
;; Test the "defrec" statement
(@byte-write 67)
(defrec succ (fun (x) (@+ x 1)))
(@byte-write (succ 64))
(defrec fact (fun (x) (if (@= x 0) 1 (@* x (fact (@- x 1))))))
(@byte-write (@- (fact 5) 54))
(defrec fact (fun (x) (@+ x 2)))
(@byte-write (fact 65))