diff options
author | Case Duckworth | 2024-04-16 22:30:43 -0500 |
---|---|---|
committer | Case Duckworth | 2024-04-16 22:30:43 -0500 |
commit | f1829b87b2ffbd02b4bc578333a6cbfbe02c01b4 (patch) | |
tree | fddab4a03bbea3171672c594c37b7076b09b0aca | |
parent | Fix #\, #t, #f reading bug (diff) | |
download | lam-f1829b87b2ffbd02b4bc578333a6cbfbe02c01b4.tar.gz lam-f1829b87b2ffbd02b4bc578333a6cbfbe02c01b4.zip |
Allow empty alternative branch in "if"
-rw-r--r-- | eval.lua | 2 |
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) |