[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Help with defadvice
From: |
Craig R. Steury |
Subject: |
Re: [h-e-w] Help with defadvice |
Date: |
19 Jun 2003 15:51:29 -0400 |
>
> My elisp is not so good either, but as far as I know, apply breaks a list
> apart into separate items, calling the function with the "spread" list as
> arguments, while concat does not accept a list:
>
> (apply 'concat '("this " "is " "a " "test"))
> "this is a test"
Here's the signature for 'apply' from the Common Lisp manual (close enough to
elisp for this example):
apply function arg &rest more-args
&rest means the unspecified (and optional) number of more-args is built into an
implicit list.
apply is very flexible (good for building argument lists on the fly, etc) but
builds its argument list by appending the *last* argument supplied (it better
be a list!) to the list of all the rest of the arguments present. This is hard
to explain - but here are some examples of valid 'apply' use:
(apply '+ '(1 2)) ==> 3 ;like your example
(apply '+ 1 2 (list 3)) ==> 6
(apply '+ 1 nil) ==> 1
cs
Craig Steury
Parametric Technology Corp.
(801) 588-4613 (w)
Salt Lake City, UT 84108
address@hidden
- [h-e-w] Re: dired-execute-file, (continued)
RE: [h-e-w] Help with defadvice, Jeff Paquette, 2003/06/19
RE: [h-e-w] Help with defadvice, Jeff Paquette, 2003/06/19
RE: [h-e-w] Help with defadvice, Gallucci, David, 2003/06/19
RE: [h-e-w] Help with defadvice, Jeff Paquette, 2003/06/19
- Re: [h-e-w] Help with defadvice,
Craig R. Steury <=