Travis: split build and test into separate scripts.
[jackhill/mal.git] / tests / step3_env.mal
CommitLineData
31690700
JM
1;; Testing REPL_ENV
2(+ 1 2)
3;=>3
4(/ (- (+ 5 (* 2 3)) 3) 4)
5;=>2
6
7
8;; Testing def!
9(def! x 3)
10;=>3
11x
12;=>3
13(def! x 4)
14;=>4
15x
16;=>4
17(def! y (+ 1 7))
18;=>8
19y
20;=>8
21
22
23;; Testing let*
24(let* (z 9) z)
25;=>9
26(let* (x 9) x)
27;=>9
28x
29;=>4
30(let* (z (+ 2 3)) (+ 1 z))
31;=>6
32(let* (p (+ 2 3) q (+ 2 p)) (+ p q))
33;=>12
34
6f58a926
GL
35;; Testing outer environment
36(def! a 4)
37;=>4
38(let* (q 9) q)
39;=>9
40(let* (q 9) a)
41;=>4
42(let* (z 2) (let* (q 9) a))
43;=>4
44
9af8aee6
JM
45;;
46;; -------- Optional Functionality --------
31690700 47
f5223195
JM
48;; Testing let* with vector bindings
49(let* [z 9] z)
50;=>9
51(let* [p (+ 2 3) q (+ 2 p)] (+ p q))
52;=>12
53
31690700
JM
54;; Testing vector evaluation
55(let* (a 5 b 6) [3 4 a [b 7] 8])
56;=>[3 4 5 [6 7] 8]