aboutsummaryrefslogtreecommitdiff
path: root/miniMAL/step2_eval.json
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-16 00:33:30 -0600
committerJoel Martin <github@martintribe.org>2015-02-16 00:33:30 -0600
commit320455465294f170f54cda772142f4de4cb6f602 (patch)
tree43c99b1539f192954f1f7ff18fed2b132c191431 /miniMAL/step2_eval.json
parentd90c784472f6131f28612eb6eaa02404e002178d (diff)
downloadmal-320455465294f170f54cda772142f4de4cb6f602.tar.gz
mal-320455465294f170f54cda772142f4de4cb6f602.zip
miniMAL: keyword, vector and hash-map support.
Diffstat (limited to 'miniMAL/step2_eval.json')
-rw-r--r--miniMAL/step2_eval.json12
1 files changed, 11 insertions, 1 deletions
diff --git a/miniMAL/step2_eval.json b/miniMAL/step2_eval.json
index f5cc113..ee95fe2 100644
--- a/miniMAL/step2_eval.json
+++ b/miniMAL/step2_eval.json
@@ -16,7 +16,17 @@
["throw", ["str", ["`", "'"], "sym", ["`", "' not found"]]]]],
["if", ["list?", "ast"],
["map", ["fn", ["x"], ["EVAL", "x", "env"]], "ast"],
- "ast"]]]],
+ ["if", ["vector?", "ast"],
+ ["vectorl", ["map", ["fn", ["x"], ["EVAL", "x", "env"]], "ast"]],
+ ["if", ["map?", "ast"],
+ ["let", ["new-hm", ["hash-map"]],
+ ["do",
+ ["map", ["fn", ["k"], ["set", "new-hm",
+ ["EVAL", "k", "env"],
+ ["EVAL", ["get", "ast", "k"], "env"]]],
+ ["keys", "ast"]],
+ "new-hm"]],
+ "ast"]]]]]],
["def", "EVAL", ["fn", ["ast", "env"],
["if", ["not", ["list?", "ast"]],