GNU bug report logs - #25166
It shouldn't be possible to set the function cell of t

Previous Next

Package: emacs;

Reported by: Philipp <p.stephani2 <at> gmail.com>

Date: Sun, 11 Dec 2016 09:47:02 UTC

Severity: wishlist

Tags: wontfix

Found in version 26.0.50

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 25166 <at> debbugs.gnu.org
Subject: bug#25166: 26.0.50; It shouldn't be possible to set the function cell of nil and t
Date: Mon, 26 Dec 2016 19:29:17 +0000
[Message part 1 (text/plain, inline)]
Glenn Morris <rgm <at> gnu.org> schrieb am Mo., 12. Dez. 2016 um 21:25 Uhr:

> Glenn Morris wrote:
>
> > Philipp wrote:
> >
> >> You can set the function cell of nil and t using `fset' and friends.
> >> But you can't call the `nil' function using (nil) (it does work with
> >> (t)).  I think that attempting to set the function cell of nil and t is
> >> almost always a bug -- probably the programmer wanted to set a real
> >> symbol, but some of the constants got passed.  I propose to signal an
> >> error (e.g. `setting-constant') whenever the function cell of nil and t
> >> is modified; maybe the same should happen for keywords.
> >
> > I just did this yesterday...
> > See https://debbugs.gnu.org/25110, ba8e883, and 3fd4433.
>
> And now see also ffb1302. :)
> Anyway, I only did "nil", since as you say "t" can actually be called as
> a function. But you are right that it's probably unintended.
>
>
Thanks! Interestingly the behavior was already added in 1994 (commit
c15c5d408d696928862ca2848a359231e373556c), but apparently reverted later.
I'd suggest to simply reinstate that commit.
[Message part 2 (text/html, inline)]

This bug report was last modified 7 years and 267 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.