aboutsummaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 5d3c32326db..c34c11828c5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2371,6 +2371,8 @@ eval_sub (Lisp_Object form)
2371DEFUN ("apply", Fapply, Sapply, 1, MANY, 0, 2371DEFUN ("apply", Fapply, Sapply, 1, MANY, 0,
2372 doc: /* Call FUNCTION with our remaining args, using our last arg as list of args. 2372 doc: /* Call FUNCTION with our remaining args, using our last arg as list of args.
2373Then return the value FUNCTION returns. 2373Then return the value FUNCTION returns.
2374With a single argument, call the argument's first element using the
2375other elements as args.
2374Thus, (apply \\='+ 1 2 \\='(3 4)) returns 10. 2376Thus, (apply \\='+ 1 2 \\='(3 4)) returns 10.
2375usage: (apply FUNCTION &rest ARGUMENTS) */) 2377usage: (apply FUNCTION &rest ARGUMENTS) */)
2376 (ptrdiff_t nargs, Lisp_Object *args) 2378 (ptrdiff_t nargs, Lisp_Object *args)
@@ -2381,6 +2383,10 @@ usage: (apply FUNCTION &rest ARGUMENTS) */)
2381 Lisp_Object fun = args[0]; 2383 Lisp_Object fun = args[0];
2382 USE_SAFE_ALLOCA; 2384 USE_SAFE_ALLOCA;
2383 2385
2386 if (nargs == 1)
2387 /* Special case: FUN is really a list of (FUNCTION . ARGS). */
2388 return CALLN (Fapply, CAR (fun), CDR (fun));
2389
2384 ptrdiff_t numargs = list_length (spread_arg); 2390 ptrdiff_t numargs = list_length (spread_arg);
2385 2391
2386 if (numargs == 0) 2392 if (numargs == 0)