projects
/
scheme.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add notes on ownership
[scheme.git]
/
tests.scm
diff --git
a/tests.scm
b/tests.scm
index 67d8b306140d6502c363fe153227ee4445c6d60e..bcda209fe2b069bc3778b5f80665877203d067cb 100644
(file)
--- a/
tests.scm
+++ b/
tests.scm
@@
-69,6
+69,7
@@
'int)
(test-prog '(+ 1 2) 3)
'int)
(test-prog '(+ 1 2) 3)
+(test-prog '(bool->int (= 2 0)) 0)
(test-prog '((lambda (x) ((lambda (y) (+ x y)) 42)) 100) 142)
(test-prog '(* 10 5) 50)
(test-prog '((lambda (x) ((lambda (y) (+ x y)) 42)) 100) 142)
(test-prog '(* 10 5) 50)
@@
-102,3
+103,12
@@
(f f (- n 1) (+ x 1)))))]
(inc inc 3 2))
5)
(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)