[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to quote a list of functions?
From: |
Pascal J. Bourguignon |
Subject: |
Re: How to quote a list of functions? |
Date: |
Sun, 09 Aug 2015 03:23:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> "Pascal J. Bourguignon" <pjb@informatimago.com> writes:
>
>> The difference, in emacs lisp, is when you compile a lambda form.
>
> AFAIK, there is also a difference for function names when compiling:
> using #'fun you enable checking whether `fun' is defined, using 'fun, it
> is not checked. So it is preferable to use #' for symbols intended to
> be used as a function.
Agreed.
However, my conclusion is that if you want to designate a list of
(global) functions, you can easily do it by having a literal list of
symbols naming those functions:
(defvar *trigs* '(sin cos tan))
(mapcar (lambda (f) (funcall f (/ pi 3))) *trigs*)
--> (0.8660254037844386 0.5000000000000001 1.7320508075688767)
I wouldn't lose sleep over:
(defvar *trigs* (list (function sin) (function cos) (function tan)))
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
- Re: How to quote a list of functions?, (continued)
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/19
- Re: How to quote a list of functions?, tomas, 2015/08/18
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/18
- Message not available
- Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/14
- Re: How to quote a list of functions?, Emanuel Berg, 2015/08/14
Re: How to quote a list of functions?, Pascal J. Bourguignon, 2015/08/08
Re: How to quote a list of functions?, Marcin Borkowski, 2015/08/09