mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Moved ice-9/ and oop/ under module/, with the idea being that we have only scheme under module/. Adjusted configure.in and Makefile.am appropriately. Put oop/ at the end of the compilation order.
17 lines
276 B
Scheme
17 lines
276 B
Scheme
(define-module (ice-9 debugging example-fns)
|
|
#:export (fact1 fact2 facti))
|
|
|
|
(define (fact1 n)
|
|
(if (= n 0)
|
|
1
|
|
(* n (fact1 (- n 1)))))
|
|
|
|
(define (facti n a)
|
|
(if (= n 0)
|
|
a
|
|
(facti (- n 1) (* a n))))
|
|
|
|
(define (fact2 n)
|
|
(facti n 1))
|
|
|
|
; Test: (fact2 3)
|