aboutsummaryrefslogtreecommitdiff
path: root/interpreter.py
diff options
context:
space:
mode:
authormryouse2022-05-24 03:36:08 +0000
committermryouse2022-05-24 03:36:08 +0000
commit57c14ee840872853fe3a7ba3141bab5f7a60e6ce (patch)
tree45828b5bcd23266d81a53064bf1a45a401a5c902 /interpreter.py
parentc8f500bd280068900273281cf267f76447b6a554 (diff)
return empty lists as-is
Diffstat (limited to 'interpreter.py')
-rw-r--r--interpreter.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/interpreter.py b/interpreter.py
index 576af47..09f298b 100644
--- a/interpreter.py
+++ b/interpreter.py
@@ -101,6 +101,9 @@ def evaluate(expr, env):
# if it's a literal list, return it
if expr.data:
return expr
+ # if it's an empty list, return it
+ elif len(expr.args) == 0:
+ return expr
if not isinstance(expr.args[0], Symbol):
raise Exception("can't evaluate without a symbol")