From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: is this a bug? Date: Fri, 28 Mar 2008 23:10:19 +0100 Organization: Informatimago Message-ID: <87tziqpkj8.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206744789 17424 80.91.229.12 (28 Mar 2008 22:53:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2008 22:53:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 28 23:53:41 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JfNS1-0004Cv-81 for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2008 23:53:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfNRP-0001xn-Rt for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2008 18:52:55 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!proxad.net!feeder1-2.proxad.net!cleanfeed4-b.proxad.net!nnrp15-2.free.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en X-Disabled: X-No-Archive: no User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:M2EzYjYwOWQ5MzhhNzdlNGFlNTVmZjJjYjQ4YjkxZDkxMGQ1NDJjMg== Original-Lines: 57 Original-NNTP-Posting-Date: 28 Mar 2008 23:10:19 MET Original-NNTP-Posting-Host: 88.180.86.168 Original-X-Trace: 1206742219 news-4.free.fr 8420 88.180.86.168:37873 Original-X-Complaints-To: abuse@proxad.net Original-Xref: shelby.stanford.edu gnu.emacs.help:157414 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52783 Archived-At: David Roderick writes: > 9.2.4 Symbol Function Indirection > --------------------------------- > > -- Function: indirect-function function &optional noerror > This function returns the meaning of FUNCTION as a function. If > FUNCTION is a symbol, then it finds FUNCTION's function definition > and starts over with that value. If FUNCTION is not a symbol, > then it returns FUNCTION itself. > > This function signals a `void-function' error if the final symbol > is unbound and optional argument NOERROR is `nil' or omitted. > Otherwise, if NOERROR is non-`nil', it returns `nil' if the final > symbol is unbound. > > It signals a `cyclic-function-indirection' error if there is a > loop in the chain of symbols. > > Here is how you could define `indirect-function' in Lisp: > > (defun indirect-function (function) > (if (symbolp function) > (indirect-function (symbol-function function)) > function)) > > > shouldn't this be? > > (defun indirect-function (function) > (if (symbolp function) > (symbol-function function) That wouldn't be the same thing. (setf (symbol-function 'c) (symbol-function 'car) (symbol-function 'b) (symbol-function 'c) (symbol-function 'a) (symbol-function 'b)) (indirect-function 'a) --> # ; is more usefull than b > (function)) Is invalid, function is a special operator that takes one argument, a symbol or a lambda form. Note that in emacs lisp, function == quote, but is a hint for the compiler that the argument of function shall be compiled. -- __Pascal Bourguignon__ http://www.informatimago.com/ HANDLE WITH EXTREME CARE: This product contains minute electrically charged particles moving at velocities in excess of five hundred million miles per hour.