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 /php/step9_interop.php | |
| 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 'php/step9_interop.php')
| -rw-r--r-- | php/step9_interop.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/php/step9_interop.php b/php/step9_interop.php index a699109..3debdc4 100644 --- a/php/step9_interop.php +++ b/php/step9_interop.php @@ -122,16 +122,14 @@ function MAL_EVAL($ast, $env) { break; case "fn*": return _function('MAL_EVAL', 'native', - _hash_map('exp', $ast[2], - 'env', $env, - 'params', $ast[1])); + $ast[2], $env, $ast[1]); default: $el = eval_ast($ast, $env); $f = $el[0]; $args = array_slice($el->getArrayCopy(), 1); if ($f->type === 'native') { - $ast = $f->meta['exp']; - $env = new Env($f->meta['env'], $f->meta['params'], $args); + $ast = $f->ast; + $env = $f->gen_env($args); } else { return $f->apply($args); } |
