From fede40f2798ac7d8ca75c5515508f0b133d2393d Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 5 Oct 2019 11:47:25 -0500 Subject: [PATCH] Relax requirement minimum arity of `fn` A valid `fn` special could have only a parameter list, as recommended by R. DuPlain. --- src/core/specials.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/specials.c b/src/core/specials.c index 8e10594a..8fa650b4 100644 --- a/src/core/specials.c +++ b/src/core/specials.c @@ -661,8 +661,8 @@ static JanetSlot janetc_fn(JanetFopts opts, int32_t argn, const Janet *argv) { c->scope->flags |= JANET_SCOPE_CLOSURE; janetc_scope(&fnscope, c, JANET_SCOPE_FUNCTION, "function"); - if (argn < 2) { - errmsg = "expected at least 2 arguments to function literal"; + if (argn == 0) { + errmsg = "expected at least 1 argument to function literal"; goto error; }