aboutsummaryrefslogtreecommitdiff
path: root/js/stepA_more.js
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-09 23:58:27 -0500
committerJoel Martin <github@martintribe.org>2014-04-09 23:58:27 -0500
commita34b02006527d28db5df5c6553be804770b81f79 (patch)
tree526fe400e5a8c34b32a3d93439197db09c7f84ad /js/stepA_more.js
parentedc3b0640f1b773e185550448e2086279f7b1a7f (diff)
downloadmal-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 'js/stepA_more.js')
-rw-r--r--js/stepA_more.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/stepA_more.js b/js/stepA_more.js
index c37668a..6a2b949 100644
--- a/js/stepA_more.js
+++ b/js/stepA_more.js
@@ -130,9 +130,9 @@ function _EVAL(ast, env) {
return types._function(EVAL, Env, a2, env, a1);
default:
var el = eval_ast(ast, env), f = el[0], meta = f.__meta__;
- if (meta && meta.exp) {
- ast = meta.exp;
- env = new Env(meta.env, meta.params, el.slice(1));
+ if (f.__ast__) {
+ ast = f.__ast__;
+ env = f.__gen_env__(el.slice(1));
} else {
return f.apply(f, el.slice(1));
}