aboutsummaryrefslogtreecommitdiff
path: root/tests/step3_env.mal
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-03-24 16:32:24 -0500
committerJoel Martin <github@martintribe.org>2014-03-24 16:32:24 -0500
commit3169070063b2cb877200117ebb384269d73bcb93 (patch)
tree23de3db1ea5c37afd21a45b6ed7771f56a08c0c4 /tests/step3_env.mal
downloadmal-3169070063b2cb877200117ebb384269d73bcb93.tar.gz
mal-3169070063b2cb877200117ebb384269d73bcb93.zip
Current state of mal for Clojure West lighting talk.
Diffstat (limited to 'tests/step3_env.mal')
-rw-r--r--tests/step3_env.mal38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/step3_env.mal b/tests/step3_env.mal
new file mode 100644
index 0000000..448a446
--- /dev/null
+++ b/tests/step3_env.mal
@@ -0,0 +1,38 @@
+;; Testing REPL_ENV
+(+ 1 2)
+;=>3
+(/ (- (+ 5 (* 2 3)) 3) 4)
+;=>2
+
+
+;; Testing def!
+(def! x 3)
+;=>3
+x
+;=>3
+(def! x 4)
+;=>4
+x
+;=>4
+(def! y (+ 1 7))
+;=>8
+y
+;=>8
+
+
+;; Testing let*
+(let* (z 9) z)
+;=>9
+(let* (x 9) x)
+;=>9
+x
+;=>4
+(let* (z (+ 2 3)) (+ 1 z))
+;=>6
+(let* (p (+ 2 3) q (+ 2 p)) (+ p q))
+;=>12
+
+
+;; Testing vector evaluation
+(let* (a 5 b 6) [3 4 a [b 7] 8])
+;=>[3 4 5 [6 7] 8]