diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval.c | 6 |
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) | |||
| 2371 | DEFUN ("apply", Fapply, Sapply, 1, MANY, 0, | 2371 | DEFUN ("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. |
| 2373 | Then return the value FUNCTION returns. | 2373 | Then return the value FUNCTION returns. |
| 2374 | With a single argument, call the argument's first element using the | ||
| 2375 | other elements as args. | ||
| 2374 | Thus, (apply \\='+ 1 2 \\='(3 4)) returns 10. | 2376 | Thus, (apply \\='+ 1 2 \\='(3 4)) returns 10. |
| 2375 | usage: (apply FUNCTION &rest ARGUMENTS) */) | 2377 | usage: (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) |