Perl: add step1_read_print, types.
[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
35
36;; Testing vector evaluation
37(let* (a 5 b 6) [3 4 a [b 7] 8])
38;=>[3 4 5 [6 7] 8]