aboutsummaryrefslogtreecommitdiffstats
path: root/tests/variables_expected.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/variables_expected.txt')
-rw-r--r--tests/variables_expected.txt34
1 files changed, 23 insertions, 11 deletions
diff --git a/tests/variables_expected.txt b/tests/variables_expected.txt
index 2e6e2be..02a5f7a 100644
--- a/tests/variables_expected.txt
+++ b/tests/variables_expected.txt
@@ -1,11 +1,23 @@
1(error? (def a 1)) -> false 1(def a 20)
2a -> 1 2((lambda (a b) (+ 10 a b)) 1 2) -> 13
3(error? (def a 300)) -> false 3((lambda (a b) (+ 10 a b)) a 3) -> 33
4a -> 300 4(def myfun (lambda (a b) (+ a b))) (myfun 6 9) -> 15
5(error? (def a "strings")) -> false 5(fun myfun (a b) (+ a b)) (myfun 6 9) -> 15
6a -> "strings" 6(+ 1 (myfun 10 (myfun a a)) 30) -> 81
7(error? (def a 1)) -> false 7(myfun 10 (myfun 5 0)) -> 15
8a -> (:quoted :symbols 123 :or "strings") 8(fun make-counter () (def value 0) (def counter (lambda () (set! value (+ value 1)) value)) counter)
9(error? (set! a 42)) -> false 9(def counter-a (make-counter))
10a -> 42 10(def counter-b (make-counter))
11(error? (set! b 99)) -> true 11(counter-a) -> 1
12(counter-b) -> 1
13(counter-a) -> 2
14(counter-a) -> 3
15(counter-a) -> 4
16(counter-b) -> 2
17(counter-b) -> 3
18(counter-b) -> 4
19(fun fib (n) (if (<= n 2) 1 (+ (fib (- n 1)) (fib (- n 2)))))
20(fib 15) -> 610
21(fun b () (display a) (print " --- ") (def a 42) (display a) (newline))
22(b) -> 20 --- 42
23(b) -> 20 --- 42