From 10b07148ba8efec543ded60a4b7916960709ce1e Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 7 Mar 2015 09:04:07 -0600 Subject: All step0: add test, fix bugs, remove step0 eval. --- php/step0_repl.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'php/step0_repl.php') diff --git a/php/step0_repl.php b/php/step0_repl.php index eecb052..421173c 100644 --- a/php/step0_repl.php +++ b/php/step0_repl.php @@ -9,12 +9,12 @@ function READ($str) { // eval function MAL_EVAL($ast, $env) { - return eval($ast); + return $ast; } // print function MAL_PRINT($exp) { - return var_export($exp, true) . "\n"; + return $exp; } // repl @@ -26,8 +26,8 @@ function rep($str) { do { $line = mal_readline("user> "); if ($line === NULL) { break; } - if (!empty($line)) { - print(rep($line)); + if ($line !== "") { + print(rep($line) . "\n"); } } while (true); -- cgit v1.2.3