diff --git a/src/prim.c b/src/prim.c index 86e5cba..43f0374 100644 --- a/src/prim.c +++ b/src/prim.c @@ -336,11 +336,11 @@ struct Prim_Init { */ { P_Quote, "quote", 1, 1, NOEVAL }, { P_Quasiquote, "quasiquote", 1, 1, NOEVAL }, - { P_Begin, "begin", 1, MANY, NOEVAL }, - { P_Begin1, "begin1", 1, MANY, NOEVAL }, + { P_Begin, "begin", 0, MANY, NOEVAL }, + { P_Begin1, "begin1", 0, MANY, NOEVAL }, { P_If, "if", 2, MANY, NOEVAL }, { P_Case, "case", 2, MANY, NOEVAL }, - { P_Cond, "cond", 1, MANY, NOEVAL }, + { P_Cond, "cond", 0, MANY, NOEVAL }, { P_Do, "do", 2, MANY, NOEVAL }, { P_Let, "let", 2, MANY, NOEVAL }, { P_Letseq, "let*", 2, MANY, NOEVAL }, diff --git a/src/special.c b/src/special.c index df6387a..b90f192 100644 --- a/src/special.c +++ b/src/special.c @@ -131,7 +131,7 @@ Object P_Begin (Object forms) { TC_Prolog; if (Nullp (forms)) - return Null; + return Unspecified; GC_Link (forms); TC_Disable; for ( ; !Nullp (Cdr (forms)); forms = Cdr (forms)) @@ -147,6 +147,8 @@ Object P_Begin1 (Object forms) { GC_Node; TC_Prolog; + if (Nullp (forms)) + return Unspecified; GC_Link (forms); TC_Disable; for (n = 1; !Nullp (Cdr (forms)); n = 0, forms = Cdr (forms)) { @@ -229,6 +231,9 @@ Object P_Cond (Object argl) { GC_Node3; TC_Prolog; + if (Nullp (argl)) + return Unspecified; + ret = False; clause = guard = Null; GC_Link3 (argl, clause, guard);