diff options
| author | Joel Martin <github@martintribe.org> | 2015-02-28 10:35:04 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-02-28 10:35:04 -0600 |
| commit | 2ab1e5845c213a9951bee46a0c991202e6c46d5c (patch) | |
| tree | ac1e5d898523bb892181804aa64f22ec4f4b9032 /php/stepA_interop.php | |
| parent | 1218ce98a40ef243824fed0efce7160a10fe5f36 (diff) | |
| download | mal-2ab1e5845c213a9951bee46a0c991202e6c46d5c.tar.gz mal-2ab1e5845c213a9951bee46a0c991202e6c46d5c.zip | |
Multiple: interop enhancements.
Diffstat (limited to 'php/stepA_interop.php')
| -rw-r--r-- | php/stepA_interop.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/php/stepA_interop.php b/php/stepA_interop.php index 8c67c66..1dc3b04 100644 --- a/php/stepA_interop.php +++ b/php/stepA_interop.php @@ -109,7 +109,19 @@ function MAL_EVAL($ast, $env) { case "macroexpand": return macroexpand($ast[1], $env); case "php*": - return eval($ast[1]); + $res = eval($ast[1]); + switch (gettype($res)) { + case "array": + if ($res !== array_values($res)) { + $new_res = _hash_map(); + $new_res->exchangeArray($res); + return $new_res; + } else { + return call_user_func_array('_list', $res); + } + default: + return $res; + } case "try*": $a1 = $ast[1]; $a2 = $ast[2]; |
