From c2e80904ad3cfd5f911d60aac0c4d64ac2081a68 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 16 Jul 2020 20:53:11 +0200 Subject: [PATCH] core: apply_builtin: Prepare for M2-Planet. * src/eval-apply.c (apply_builtin): Prepare for M2-Planet. --- src/eval-apply.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/eval-apply.c b/src/eval-apply.c index 28b87d88..786dc991 100644 --- a/src/eval-apply.c +++ b/src/eval-apply.c @@ -288,9 +288,12 @@ SCM apply_builtin (SCM fn, SCM x) /*:((internal)) */ { int arity = VALUE (builtin_arity (fn)); - if ((arity > 0 || arity == -1) && x != cell_nil && TYPE (CAR (x)) == TVALUES) - x = cons (CADAR (x), CDR (x)); - if ((arity > 1 || arity == -1) && x != cell_nil && TYPE (CDR (x)) == TPAIR && TYPE (CADR (x)) == TVALUES) + if ((arity > 0 || arity == -1) && x != cell_nil) + if (TYPE (CAR (x)) == TVALUES) + x = cons (CADAR (x), CDR (x)); + if ((arity > 1 || arity == -1) && x != cell_nil) + if (TYPE (CDR (x)) == TPAIR) + if (TYPE (CADR (x)) == TVALUES) x = cons (CAR (x), cons (CDADAR (x), CDR (x))); #if __M2_PLANET__