mirror of
https://github.com/janet-lang/janet
synced 2024-12-02 21:09:55 +00:00
Relax requirement minimum arity of fn
A valid `fn` special could have only a parameter list, as recommended by R. DuPlain.
This commit is contained in:
parent
6ae5a9be60
commit
fede40f279
@ -661,8 +661,8 @@ static JanetSlot janetc_fn(JanetFopts opts, int32_t argn, const Janet *argv) {
|
|||||||
c->scope->flags |= JANET_SCOPE_CLOSURE;
|
c->scope->flags |= JANET_SCOPE_CLOSURE;
|
||||||
janetc_scope(&fnscope, c, JANET_SCOPE_FUNCTION, "function");
|
janetc_scope(&fnscope, c, JANET_SCOPE_FUNCTION, "function");
|
||||||
|
|
||||||
if (argn < 2) {
|
if (argn == 0) {
|
||||||
errmsg = "expected at least 2 arguments to function literal";
|
errmsg = "expected at least 1 argument to function literal";
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user