Skip to content

Commit

Permalink
Add a proper error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
tadd committed Feb 22, 2025
1 parent 4b1bdb2 commit 461b108
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions schaf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,9 @@ static Value let(Value *env, const char *func, Value bindings, Value body)
Value letenv = *env;
for (Value p = bindings; p != Qnil; p = cdr(p)) {
Value b = car(p);
if (b == Qnil)
continue;
expect_type(func, TYPE_PAIR, b);
if (length(b) != 2)
runtime_error("%s: malformed binding in let: %s", func, stringify(b));
Value ident = car(b), expr = cadr(b);
expect_type(func, TYPE_SYMBOL, ident);
env_put(&letenv, ident, eval(env, expr));
Expand Down

0 comments on commit 461b108

Please sign in to comment.