HCoop
/
jackhill
/
mal.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Nim: step8
[jackhill/mal.git]
/
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 (* 222 311)) 300) 41)
15
;=>1689
16
17
(abc 1 2 3)
18
; .*\'abc\' not found.*
19
20
;;
21
;; -------- Optional Functionality --------
22
23
;; Testing evaluation within collection literals
24
[1 2 (+ 1 2)]
25
;=>[1 2 3]
26
27
{"a" (+ 7 8)}
28
;=>{"a" 15}
29
30
{:a (+ 7 8)}
31
;=>{:a 15}