feat: 9.5.9
This commit is contained in:
parent
cb1753732b
commit
35f43a7909
1084 changed files with 558985 additions and 0 deletions
11
examples/fact.ss
Normal file
11
examples/fact.ss
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
;;; simple factorial function
|
||||
|
||||
;;; it is interesting to change the 'lambda' into 'trace-lambda'
|
||||
;;; or simply type (trace fact) before running fact to observe
|
||||
;;; the nesting of recursive calls.
|
||||
|
||||
(define fact
|
||||
(lambda (x)
|
||||
(if (zero? x)
|
||||
1
|
||||
(* x (fact (1- x))))))
|
||||
Reference in a new issue