about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2024-04-16 22:30:43 -0500
committerCase Duckworth2024-04-16 22:30:43 -0500
commitf1829b87b2ffbd02b4bc578333a6cbfbe02c01b4 (patch)
treefddab4a03bbea3171672c594c37b7076b09b0aca
parentFix #\, #t, #f reading bug (diff)
downloadlam-f1829b87b2ffbd02b4bc578333a6cbfbe02c01b4.tar.gz
lam-f1829b87b2ffbd02b4bc578333a6cbfbe02c01b4.zip
Allow empty alternative branch in "if"
-rw-r--r--eval.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.lua b/eval.lua index 342624f..287509d 100644 --- a/eval.lua +++ b/eval.lua
@@ -69,7 +69,7 @@ m.primitives = {
69 end, 69 end,
70 ["if"] = 70 ["if"] =
71 function (r, e) 71 function (r, e)
72 assert_arity(r,3,3) 72 assert_arity(r,2,3)
73 local test, conseq, alt = r[1], r[2][1], r[2][2][1] 73 local test, conseq, alt = r[1], r[2][1], r[2][2][1]
74 if m.eval(test, e) 74 if m.eval(test, e)
75 then return m.eval(conseq, e) 75 then return m.eval(conseq, e)