From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Roderick Newsgroups: gmane.emacs.bugs Subject: Re: is this incorrect code in elisp manual? Date: Mon, 07 Apr 2008 21:18:38 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207667001 22689 80.91.229.12 (8 Apr 2008 15:03:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Apr 2008 15:03:21 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 08 17:03:53 2008 Return-path: Envelope-to: geb-bug-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 1JjFLT-00071h-Vv for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Apr 2008 17:02:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JjFKq-0001L3-Jx for geb-bug-gnu-emacs@m.gmane.org; Tue, 08 Apr 2008 11:02:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jiy9g-0004VA-3d for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2008 16:41:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jiy9e-0004Uv-K1 for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2008 16:41:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jiy9e-0004Us-HK for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2008 16:41:26 -0400 Original-Received: from mk-filter-4-a-1.mail.uk.tiscali.com ([212.74.100.55]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jiy9d-0000iq-KK for bug-gnu-emacs@gnu.org; Mon, 07 Apr 2008 16:41:26 -0400 Original-X-Trace: 692513077/mk-filter-4.mail.uk.tiscali.com/B2C/$THROTTLED-DYNAMIC/CUSTOMER-DYNAMIC-IP/79.73.171.138 X-SBRS: None X-RemoteIP: 79.73.171.138 X-IP-MAIL-FROM: angel_ov_north@tiscali.co.uk X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAH8j+kdPSauK/2dsb2JhbACrCA Original-Received: from 79-73-171-138.dynamic.dsl.as9105.com (HELO DAVIDR) ([79.73.171.138]) by smtp.tiscali.co.uk with ESMTP; 07 Apr 2008 21:18:40 +0100 User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.990 (windows-nt) Cancel-Lock: sha1:OAMeGFbVo3H5HLYB/bCRFPgJle8= In-Reply-To: (David Roderick's message of "Fri\, 28 Mar 2008 21\:27\:48 +0000") X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Mailman-Approved-At: Tue, 08 Apr 2008 10:59:35 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:17815 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) > (function)) > > > -- > from > David Roderick -- from David Roderick