aboutsummaryrefslogtreecommitdiff
path: root/miniMAL/core.json
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-02-15 16:34:55 -0600
committerJoel Martin <github@martintribe.org>2015-02-15 16:34:55 -0600
commitc5d302358e0b519f9de6d570158d07d60fda6d97 (patch)
tree4705f31f4485a1b9501a08dac5728beef08a352c /miniMAL/core.json
parent7ebf5219e1be21ed10cecabda8262c77da7465ae (diff)
downloadmal-c5d302358e0b519f9de6d570158d07d60fda6d97.tar.gz
mal-c5d302358e0b519f9de6d570158d07d60fda6d97.zip
miniMAL: step4.
Diffstat (limited to 'miniMAL/core.json')
-rw-r--r--miniMAL/core.json40
1 files changed, 40 insertions, 0 deletions
diff --git a/miniMAL/core.json b/miniMAL/core.json
new file mode 100644
index 0000000..4717f77
--- /dev/null
+++ b/miniMAL/core.json
@@ -0,0 +1,40 @@
+["do",
+
+["def", "div", ["fn", ["a", "b"], ["parseInt", ["/", "a", "b"]]]],
+
+["def", "_count", ["fn", ["a"],
+ ["if", ["=", null, "a"],
+ 0,
+ ["count", "a"]]]],
+
+["def", "core-ns",
+ ["hash-map",
+ ["`", "="], "equal?",
+
+ ["`", "pr-str"], ["fn", ["&", "a"], ["pr-list", "a", true, ["`", " "]]],
+ ["`", "str"], ["fn", ["&", "a"], ["pr-list", "a", false, ["`", ""]]],
+ ["`", "prn"], ["fn", ["&", "a"],
+ ["do",
+ ["println", ["pr-list", "a", true, ["`", " "]]],
+ null]],
+ ["`", "println"], ["fn", ["&", "a"],
+ ["do",
+ ["println", ["pr-list", "a", false, ["`", " "]]],
+ null]],
+
+ ["`", "<"], "<",
+ ["`", "<="], "<=",
+ ["`", ">"], ">",
+ ["`", ">="], ">=",
+ ["`", "+"], "+",
+ ["`", "-"], "-",
+ ["`", "*"], "*",
+ ["`", "/"], "div",
+
+ ["`", "list"], "list",
+ ["`", "list?"], "list?",
+
+ ["`", "empty?"], "empty?",
+ ["`", "count"], "_count"]],
+
+null]