summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eval.c19
-rw-r--r--txr.15
2 files changed, 21 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index fc00a630..1584bd94 100644
--- a/eval.c
+++ b/eval.c
@@ -1106,9 +1106,24 @@ static val apply_frob_args(val args)
}
}
+static val apply_intrinsic_frob_args(val args)
+{
+ if (!cdr(args)) {
+ return tolist(car(args));
+ } else {
+ list_collect_decl (out, ptail);
+
+ for (; cdr(args); args = cdr(args))
+ ptail = list_collect(ptail, car(args));
+
+ list_collect_nconc(ptail, tolist(car(args)));
+ return out;
+ }
+}
+
val apply_intrinsic(val fun, val args)
{
- return apply(fun, apply_frob_args(z(args)));
+ return apply(fun, apply_intrinsic_frob_args(z(args)));
}
static val applyv(val fun, struct args *args)
@@ -1129,7 +1144,7 @@ static val iapply(val fun, struct args *args)
saved_ptail = ptail;
if (args_more(args, index)) {
- last_arg = args_get(args, &index);
+ last_arg = tolist(args_get(args, &index));
ptail = list_collect_nconc(ptail, last_arg);
}
diff --git a/txr.1 b/txr.1
index 09af87bf..4125f9a8 100644
--- a/txr.1
+++ b/txr.1
@@ -27062,7 +27062,10 @@ Secondly, if
.meta trailing-args
is a list, but an improper list, then the terminating atom of
.meta trailing-args
-becomes an ordinary argument. Thus, in all possible cases,
+becomes an individual argument.
+This terminating atom is not split into multiple arguments,
+even if it is a sequence.
+Thus, in all possible cases,
.code iapply
treats an extra
.cod2 non- nil