core: apply_builtin: Prepare for M2-Planet.

* src/eval-apply.c (apply_builtin): Prepare for M2-Planet.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-24 20:53:11 +02:00
parent 2e7c4edc82
commit f43b307d0f
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 3 deletions

View File

@ -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__