From 487a4fa34594332d15e1b84328d9916d74750db5 Mon Sep 17 00:00:00 2001 From: Pekka Laiho Date: Sat, 12 Dec 2020 09:08:37 +0700 Subject: [PATCH] remove ability to call env with argument --- src/Evaller.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Evaller.php b/src/Evaller.php index 4a505b8..745df73 100644 --- a/src/Evaller.php +++ b/src/Evaller.php @@ -206,15 +206,11 @@ class Evaller $ast = $astData[$astLength - 1]; continue; // tco } elseif ($symbolName == 'env') { - if ($astLength >= 2) { - if (!($astData[1] instanceof Symbol)) { - throw new MadLispException("first argument to env is not symbol"); - } - - return $env->get($astData[1]->getName()); - } else { - return $env; + if ($astLength != 1) { + throw new MadLispException("env does not take arguments"); } + + return $env; } elseif ($symbolName == 'eval') { if ($astLength == 1) { return null;