diff options
| author | Joel Martin <github@martintribe.org> | 2015-02-16 00:33:30 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-02-16 00:33:30 -0600 |
| commit | 320455465294f170f54cda772142f4de4cb6f602 (patch) | |
| tree | 43c99b1539f192954f1f7ff18fed2b132c191431 /miniMAL/step2_eval.json | |
| parent | d90c784472f6131f28612eb6eaa02404e002178d (diff) | |
| download | mal-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.json | 12 |
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"]], |
