From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: How to quote a list of functions? Date: Mon, 17 Aug 2015 02:06:23 +0200 Organization: Informatimago Message-ID: <87zj1qbwxs.fsf@kuiper.lan.informatimago.com> References: <871tfdjqjx.fsf@mbork.pl> <877fp5b52v.fsf@nl106-137-147.student.uu.se> <8737zs7uq3.fsf@mbork.pl> <87zj1vddkz.fsf@kuiper.lan.informatimago.com> <87mvxug2us.fsf@nl106-137-147.student.uu.se> <87vbch1gb0.fsf@nl106-137-147.student.uu.se> <87wpwudby7.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1439770028 22204 80.91.229.3 (17 Aug 2015 00:07:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Aug 2015 00:07:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 17 02:06:53 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZR7wy-0001Rq-5y for geh-help-gnu-emacs@m.gmane.org; Mon, 17 Aug 2015 02:06:52 +0200 Original-Received: from localhost ([::1]:53750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR7wx-0006HK-8n for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Aug 2015 20:06:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR7wm-0006HC-N7 for help-gnu-emacs@gnu.org; Sun, 16 Aug 2015 20:06:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZR7wj-0007uL-Bi for help-gnu-emacs@gnu.org; Sun, 16 Aug 2015 20:06:40 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:58420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR7wj-0007uC-5Q for help-gnu-emacs@gnu.org; Sun, 16 Aug 2015 20:06:37 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZR7wh-0001Cn-Qd for help-gnu-emacs@gnu.org; Mon, 17 Aug 2015 02:06:35 +0200 Original-Received: from amontsouris-654-1-150-20.w90-46.abo.wanadoo.fr ([90.46.157.20]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2015 02:06:35 +0200 Original-Received: from pjb by amontsouris-654-1-150-20.w90-46.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Aug 2015 02:06:35 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 70 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: amontsouris-654-1-150-20.w90-46.abo.wanadoo.fr Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:OWRlMDc1OWM1YmYwMmQzM2E0ZTc1OTE0ZmMyMDg0Mzg1NWFkMjcwNg== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106632 Archived-At: Emanuel Berg writes: > John Mastro writes: > >> I think you have this metaphor backward; all I said >> was that sharp-quote can be helpful (like >> indentation), not that you should be compelled to >> use it. >> >> Pascal's point (that the sameness between `quote' >> and `function' in Emacs Lisp is an implementation >> detail which, at least in principal, could change) >> is perhaps stronger, but he's not saying that Emacs >> Lisp should change to force you to use `quote' and >> `function' differently. > > This discussion is by now nothing but confusing. > > The one advantage we have heard is - if it is used, > the compiler will tell you if the function is defined, > so it is a safety net for typos and mix-ups. > > The disadvantages are: > > - Ugly syntax; and, one less char on that line > available. > > - Not clear when to use it (as this discussion > shows). > > - Until you get used to it, you have to stop and > think if it should be used or not. You don't > want to think about that, but of the problem > that you are set to solve - also, the context > and function name should already communicate > this to you, and with this syntax you may be > tempted to be more sloppy with that. It's quite simple. When you want a function given a name, you use (function NAME) or #'NAME which reads equally. When you want a symbol, you use (quote SYMBOL) or 'SYMBOL which reads equally. Accidentally, on the current GNU emacs lisp implementation, (function X) and (quote X) return the same thing, the symbol X, so if you make a mistake and write #'NAME when you need a symbol, you won't notice it (unless you compile the code and no function named NAME exist, and if you make the opposite mistake, and write 'NAME instead of #'NAME, then since 1- emacs lisp doesn't have local lexical functions (flet is just a kludge, not the real thing), and 2- symbols designate the function they name, ultimately for apply (which is the primitive called by funcall and all the other high order functions), then it doesn't make a difference. Check this AI Koan: https://en.wikipedia.org/wiki/Hacker_koan#Enlightenment The problem is not what you do, the problem is what you intend to do. -- __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