From unknown Tue Aug 19 08:37:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25166 <25166@debbugs.gnu.org> To: bug#25166 <25166@debbugs.gnu.org> Subject: Status: It shouldn't be possible to set the function cell of t Reply-To: bug#25166 <25166@debbugs.gnu.org> Date: Tue, 19 Aug 2025 15:37:12 +0000 retitle 25166 It shouldn't be possible to set the function cell of t reassign 25166 emacs submitter 25166 Philipp
Glenn Morris wrote:
> Philipp wrote:
>
>> You can set the function cell of nil and t using `fset' and fr= iends.
>> But you can't call the `nil' function using (nil) (it does= work with
>> (t)).=C2=A0 I think that attempting to set the function cell of ni= l and t is
>> almost always a bug -- probably the programmer wanted to set a rea= l
>> symbol, but some of the constants got passed.=C2=A0 I propose to s= ignal 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 actu= ally be called as
a function. But you are right that it's probably unintended.
Glenn Morris = wrote:
> Philipp wrote:
>
>> You can set the function cell of nil and t using `fset' and fr= iends.
>> But you can't call the `nil' function using (nil) (it does= work with
>> (t)).=C2=A0 I think that attempting to set the function cell of ni= l and t is
>> almost always a bug -- probably the programmer wanted to set a rea= l
>> symbol, but some of the constants got passed.=C2=A0 I propose to s= ignal 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 actu= ally be called as
a function. But you are right that it's probably unintended.