aboutsummaryrefslogtreecommitdiff
path: root/python/mal_types.py
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-12-18 20:33:49 -0600
committerJoel Martin <github@martintribe.org>2015-01-09 16:16:50 -0600
commitb8ee29b22fbaa7a01f2754b4d6dd9af52e02017c (patch)
treef4d977ed220e9a3f665cfbf4f68770a81e4c2095 /python/mal_types.py
parentaaba249304b184e12e2445ab22d66df1f39a51a5 (diff)
downloadmal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.tar.gz
mal-b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c.zip
All: add keywords.
Also, fix nth and count to match cloure.
Diffstat (limited to 'python/mal_types.py')
-rw-r--r--python/mal_types.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/mal_types.py b/python/mal_types.py
index e6bd70d..5fb9bba 100644
--- a/python/mal_types.py
+++ b/python/mal_types.py
@@ -58,6 +58,13 @@ class Symbol(str): pass
def _symbol(str): return Symbol(str)
def _symbol_Q(exp): return type(exp) == Symbol
+# Keywords
+# A specially prefixed string
+def _keyword(str):
+ if str[0] == u"\u029e": return str
+ else: return u"\u029e" + str
+def _keyword_Q(exp): return _string_Q(exp) and exp[0] == u"\u029e"
+
# Functions
def _function(Eval, Env, ast, env, params):
def fn(*args):