August <[EMAIL PROTECTED]> writes:

> On lör, 2005-02-19 at 19:43 +0100, David Kastrup wrote:
>> Joe Corneli <[EMAIL PROTECTED]> writes:
>> 
>> > Is there a shorter way to concatenate a list of strings
>> > than this?
>> >
>> >  (eval (append (list 'concat) list-of-strings))
>> >
>> > Or more generally, 
>> >
>> >  (eval (append (list 'function-that-acts-on-foos) list-of-foos))
>> 
>> (apply #'concat list-of-strings)
>> 
>
> What's the purpose of the hash sign? `(apply 'concat
> list-of-strings)' works too.

'concat is short for (quote concat), #'concat is short for
(function concat).

It tells the byte compiler that it is ok to compile the function.  For
example,

'(lambda nil (if))

is a perfectly valid list and if used in function context even in
compiled Elisp files, will be evaled the slow way at run time.
#'(lambda nil (if)) in contrast gets byte-compiled (and the byte
compiler will probably barf).


-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to