From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: is this a bug? Date: Fri, 28 Mar 2008 23:02:34 -0400 Organization: Symantec Message-ID: References: NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1206762050 26715 80.91.229.12 (29 Mar 2008 03:40:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Mar 2008 03:40:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 29 04:41:21 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 1JfRwP-0006f7-Vr for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Mar 2008 04:41:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfRvo-0003xO-Ej for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Mar 2008 23:40:36 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Fri, 28 Mar 2008 22:02:34 -0500 Original-Newsgroups: gnu.emacs.help Mail-Copies-To: nobody User-Agent: MT-NewsWatcher/3.5.3b2 (Intel Mac OS X) X-Copies-To: never Original-Lines: 43 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 24.34.108.171 Original-X-Trace: sv3-Gyn0Nc9wTkHmhio1SYoMdhMglOd+LAc1H8NezLNiXimR382pVbHPz9ndG+2zAYiBgUmrOAIbXc/MhHD!gaYwIriJHmXm6DWTwmIr33G2fsI3l+gdvOvLWM6yN7bEBKWn8Xdavdv8/ofcW21PtV/yp9bR6GUI!HY+91TseyEYZ57ueiQQWT6z/L7+NEse25EHz3Eo= Original-X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.37 Original-Xref: shelby.stanford.edu gnu.emacs.help:157415 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:52785 Archived-At: In article , David Roderick wrote: > 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) > (function)) No, because the description says it "starts over with that value", not "returns that value". It follows a chain of indirections, not just one level. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE don't copy me on replies, I'll read them in the group ***