From 8cb5cda46cf3aef847ae3926dc53a5e5f87fe261 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Wed, 16 Apr 2014 23:57:50 -0500 Subject: All: move some fns to core. Major cleanup. - Don't import/require core until step4. - Define cond/or macros from step8 --- php/step2_eval.php | 1 + 1 file changed, 1 insertion(+) (limited to 'php/step2_eval.php') 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); }; -- cgit v1.2.3