Finish step8
[jackhill/mal.git] / impls / tests / step2_eval.mal
1 ;; Testing evaluation of arithmetic operations
2 (+ 1 2)
3 ;=>3
4
5 (+ 5 (* 2 3))
6 ;=>11
7
8 (- (+ 5 (* 2 3)) 3)
9 ;=>8
10
11 (/ (- (+ 5 (* 2 3)) 3) 4)
12 ;=>2
13
14 (/ (- (+ 515 (* 87 311)) 302) 27)
15 ;=>1010
16
17 (* -3 6)
18 ;=>-18
19
20 (/ (- (+ 515 (* -87 311)) 296) 27)
21 ;=>-994
22
23 ;;; This should throw an error with no return value
24 (abc 1 2 3)
25 ;/.+
26
27 ;; Testing empty list
28 ()
29 ;=>()
30
31 ;>>> deferrable=True
32 ;;
33 ;; -------- Deferrable Functionality --------
34
35 ;; Testing evaluation within collection literals
36 [1 2 (+ 1 2)]
37 ;=>[1 2 3]
38
39 {"a" (+ 7 8)}
40 ;=>{"a" 15}
41
42 {:a (+ 7 8)}
43 ;=>{:a 15}