diff options
Diffstat (limited to 'php/step2_eval.php')
| -rw-r--r-- | php/step2_eval.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/php/step2_eval.php b/php/step2_eval.php index 0ef184a..1cec7f7 100644 --- a/php/step2_eval.php +++ b/php/step2_eval.php @@ -55,6 +55,7 @@ function rep($str) { global $repl_env; return MAL_PRINT(MAL_EVAL(READ($str), $repl_env)); } + $repl_env['+'] = function ($a, $b) { return intval($a + $b,10); }; $repl_env['-'] = function ($a, $b) { return intval($a - $b,10); }; $repl_env['*'] = function ($a, $b) { return intval($a * $b,10); }; |
