projects
/
scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e3f83f5
)
Add pow test
author
Luke Lau
<luke_lau@icloud.com>
Tue, 30 Jul 2019 00:06:10 +0000
(
01:06
+0100)
committer
Luke Lau
<luke_lau@icloud.com>
Tue, 30 Jul 2019 00:06:10 +0000
(
01:06
+0100)
tests.scm
patch
|
blob
|
history
diff --git
a/tests.scm
b/tests.scm
index f078229dd6364f78ac5769341f8f53b8d3edad27..bcda209fe2b069bc3778b5f80665877203d067cb 100644
(file)
--- a/
tests.scm
+++ b/
tests.scm
@@
-103,3
+103,12
@@
(f f (- n 1) (+ x 1)))))]
(inc inc 3 2))
5)
+
+(test-prog '(let ([go (lambda (n m x)
+ (if (= n 0)
+ x
+ (go (- n 1) m (* x m))))]
+ [pow (lambda (p y) (go p y 1))])
+
+ (pow 3 2))
+ 8)