core: apply_builtin: Prepare for M2-Planet.

* src/eval-apply.c (apply_builtin): Prepare for M2-Planet.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-07-16 20:53:11 +02:00
parent 065b026bfc
commit c2e80904ad
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273

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__