aboutsummaryrefslogtreecommitdiff
path: root/miniMAL/step3_env.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/step3_env.json
parentd90c784472f6131f28612eb6eaa02404e002178d (diff)
downloadmal-320455465294f170f54cda772142f4de4cb6f602.tar.gz
mal-320455465294f170f54cda772142f4de4cb6f602.zip
miniMAL: keyword, vector and hash-map support.
Diffstat (limited to 'miniMAL/step3_env.json')
-rw-r--r--miniMAL/step3_env.json12
1 files changed, 11 insertions, 1 deletions
diff --git a/miniMAL/step3_env.json b/miniMAL/step3_env.json
index 353c3dd..e72de07 100644
--- a/miniMAL/step3_env.json
+++ b/miniMAL/step3_env.json
@@ -14,7 +14,17 @@
["env-get", "env", "ast"],
["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", "LET", ["fn", ["env", "args"],
["if", [">", ["count", "args"], 0],