all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: ulm@gentoo.org, 73886@debbugs.gnu.org
Subject: bug#73886: 29.4; Confusing info about void function cells in Emacs Lisp manual
Date: Sun, 20 Oct 2024 12:56:03 -0400	[thread overview]
Message-ID: <jwv5xpm7mpz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86frorjqs5.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Oct 2024 08:18:34 +0300")

>> Oops.  Looks like I missed this part when I changed it back around
>> Emacs-24.4:
>> 
>>     ** In 'symbol-function', nil and "unbound" are indistinguishable.
>>     'symbol-function' does not signal a 'void-function' error any more.
>>     To determine if a symbol's function definition is void, use 'fboundp'.
>
> Could you explain the rationale for that change?  I tried to look for
> relevant discussions around that date, but came up empty-handed.

I can't remember discussing it, no.  It was a kind of "executive
decision".

Having a special "void" (`Qundefined`) non-value for the `symbol-value`
is needed for `boundp` since variables can contain *any* value, but not
for the `symbol-function` part where we can use any normal value (I
chose `nil`) to play this role as long as it doesn't collide with values
normally held in the `symbol-function` slot, like function names,
function values, cons cells, vectors, ...

The upside was a simplification in various chunks of code which used to
do things like `(and (fboundp SYM) (symbol-function SYM))` which can now
be simplified to `(symbol-function SYM)`.

I remember two "motivators", i.e. places where the need to pay attention
to the special void case annoyed me enough to look into this and make
the change, one was `nadvice.el` and the other was `cl-letf`.
[ So, it was no accident that the change happened in the same release as
  the addition of `nadvice.el`.  ]

In both cases the issue is that we want to deal with "places"
(generalized variables) and that abstraction works well for those places
which *always* contain a value, but not as well for those special places
that can be "unbound", so removing the "unbound" case from
`symbol-function` resulted in a welcome simplification.
For the same reason I dislike EIEIO's notion of `slot-boundp` and have
already considered marking it obsolete.



        Stefan






  reply	other threads:[~2024-10-20 16:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-19 14:37 bug#73886: 29.4; Confusing info about void function cells in Emacs Lisp manual Ulrich Müller
2024-10-19 17:45 ` Eli Zaretskii
2024-10-20  2:12   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-20  5:18     ` Eli Zaretskii
2024-10-20 16:56       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-27 11:17         ` Eli Zaretskii
2024-10-27 13:40           ` Ulrich Müller
2024-10-27 14:08             ` Eli Zaretskii
2024-10-27 14:59               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 16:50                 ` Eli Zaretskii
2024-10-27 17:10                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-27 17:20                     ` Eli Zaretskii
2024-10-27 18:53                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-19 19:08 ` Andreas Schwab
2024-10-19 21:07   ` Ulrich Müller

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=jwv5xpm7mpz.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73886@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=ulm@gentoo.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.