diff options
| author | Joel Martin <github@martintribe.org> | 2014-04-09 23:58:27 -0500 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2014-04-09 23:58:27 -0500 |
| commit | a34b02006527d28db5df5c6553be804770b81f79 (patch) | |
| tree | 526fe400e5a8c34b32a3d93439197db09c7f84ad /python/step8_macros.py | |
| parent | edc3b0640f1b773e185550448e2086279f7b1a7f (diff) | |
| download | mal-a34b02006527d28db5df5c6553be804770b81f79.tar.gz mal-a34b02006527d28db5df5c6553be804770b81f79.zip | |
Fix metadata on functions.
- Don't use metadata to store ast, env, params data.
- In Clojure, store metadata on the :meta key of the real metadata.
This also allows using any datatype as metadata.
Diffstat (limited to 'python/step8_macros.py')
| -rw-r--r-- | python/step8_macros.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/python/step8_macros.py b/python/step8_macros.py index 6e2bd45..5d9151a 100644 --- a/python/step8_macros.py +++ b/python/step8_macros.py @@ -107,10 +107,9 @@ def EVAL(ast, env): else: el = eval_ast(ast, env) f = el[0] - if hasattr(f, '__meta__') and f.__meta__.has_key("exp"): - m = f.__meta__ - ast = m['exp'] - env = Env(m['env'], m['params'], el[1:]) + if hasattr(f, '__ast__'): + ast = f.__ast__ + env = f.__gen_env__(el[1:]) else: return f(*el[1:]) |
