]> git.donarmstrong.com Git - lilypond.git/blob - guile18/ice-9/debugging/example-fns.scm
New upstream version 2.19.65
[lilypond.git] / guile18 / ice-9 / debugging / example-fns.scm
1 (define-module (ice-9 debugging example-fns)
2   #:export (fact1 fact2 facti))
3
4 (define (fact1 n)
5   (if (= n 0)
6       1
7       (* n (fact1 (- n 1)))))
8
9 (define (facti n a)
10   (if (= n 0)
11       a
12       (facti (- n 1) (* a n))))
13
14 (define (fact2 n)
15   (facti n 1))
16
17 ; Test: (fact2 3)