GNU bug report logs - #58513
describe-function should say that defconst variables are constant

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Fri, 14 Oct 2022 12:05:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Phil Sainty <psainty <at> orcon.net.nz>, Stefan Kangas <stefan <at> marxist.se>, 58513 <at> debbugs.gnu.org
Subject: bug#58513: describe-function should say that defconst variables are constant
Date: Sat, 15 Oct 2022 12:04:17 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> - since that new branch always signals an error (well, in my own code,
>   that is: I don't know what that branch would end up doing on `master`
>   where we'd want to be more careful about backward compatibility), it's
>   expected to be more-or-less never taken and even the most naive branch
>   predictors should handle it "perfectly".

I see; that sounds good.

So perhaps we should be moving in this direction, then.

That is, start by making defconst mark the variables (perhaps in the way
you've already implemented?), and then make byte-compilation warn about
assigning to defconsts (and make describe-function expose the
information, as requested).

And then, in a later Emacs version, we could start enforcing the
constness in running code.




This bug report was last modified 2 years and 242 days ago.

Previous Next


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