From b8ee29b22fbaa7a01f2754b4d6dd9af52e02017c Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 18 Dec 2014 20:33:49 -0600 Subject: All: add keywords. Also, fix nth and count to match cloure. --- python/mal_types.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'python/mal_types.py') 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): -- cgit v1.2.3