all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: is this a bug?
Date: Fri, 28 Mar 2008 23:02:34 -0400	[thread overview]
Message-ID: <barmar-72BD7C.23023328032008@newsgroups.comcast.net> (raw)
In-Reply-To: ur6du1quj.fsf@tiscali.co.uk

In article <ur6du1quj.fsf@tiscali.co.uk>,
 David Roderick <angel_ov_north@tiscali.co.uk> 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 ***


  parent reply	other threads:[~2008-03-29  3:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 21:27 is this a bug? David Roderick
2008-03-28 22:10 ` Pascal Bourguignon
2008-03-29  3:02 ` Barry Margolin [this message]
2008-04-07 20:18 ` is this incorrect code in elisp manual? David Roderick
  -- strict thread matches above, loose matches on Subject: below --
2009-09-16 22:31 Is this a bug? Leo
2012-09-27  9:36 Is this a bug ? horse_rivers
2012-09-27 17:12 ` Eli Zaretskii
2012-09-28  0:27   ` horse_rivers
2012-09-28  7:30     ` Eli Zaretskii
2013-12-02 13:51 Is this a bug? Perry Smith
2013-12-03  8:46 ` Tassilo Horn
2013-12-03  9:16 ` Tassilo Horn
2022-06-17 17:16 hput

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-72BD7C.23023328032008@newsgroups.comcast.net \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.