diff options
author | Andy Wingo <wingo@pobox.com> | 2008-11-01 12:44:21 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-11-01 12:44:21 +0100 |
commit | 00d04892052f345a844c967adbe77c258896c1e7 (patch) | |
tree | 6e99b35f9d7d6ac1fe7b452bcad96cfb20f055b8 /module/ice-9/debugging/example-fns.scm | |
parent | 5192c9e89bc18e5f6b33741aceed66bf28d56823 (diff) | |
download | guile-00d04892052f345a844c967adbe77c258896c1e7.tar.gz |
move ice-9/ and oop/ under module/
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.
Diffstat (limited to 'module/ice-9/debugging/example-fns.scm')
-rw-r--r-- | module/ice-9/debugging/example-fns.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/module/ice-9/debugging/example-fns.scm b/module/ice-9/debugging/example-fns.scm new file mode 100644 index 000000000..30d412f00 --- /dev/null +++ b/module/ice-9/debugging/example-fns.scm @@ -0,0 +1,17 @@ +(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) |