OSDN Git Service
(root)
/
happyabc
/
happyabc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cabe7a3
)
Add example for recurtion (NOTE: not working NOW)
author
MIZUNO Hiroki
<mzpppp@gmail.com>
Thu, 19 Jun 2008 14:45:04 +0000
(23:45 +0900)
committer
MIZUNO Hiroki
<mzpppp@gmail.com>
Thu, 19 Jun 2008 14:45:04 +0000
(23:45 +0900)
example/rec.scm
[new file with mode: 0644]
patch
|
blob
diff --git a/example/rec.scm
b/example/rec.scm
new file mode 100644
(file)
index 0000000..
2380978
--- /dev/null
+++ b/
example/rec.scm
@@ -0,0
+1,11
@@
+(let ([f (lambda (n) (print "not rec"))])
+ (let ([f (lambda (n) (if (= n 0)
+ (print "rec")
+ (f 0)))])
+ (f 1)))
+
+(let ([f (lambda (n) (print "not rec"))])
+ (letrec ([f (lambda (n) (if (= n 0)
+ (print "rec")
+ (f 0)))])
+ (f 1)))
\ No newline at end of file