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 Kangas <stefankangas <at> gmail.com>
Cc: psainty <at> orcon.net.nz, 58513 <at> debbugs.gnu.org, rms <at> gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#58513: describe-function should say that defconst variables are constant
Date: Mon, 17 Oct 2022 12:41:13 +0200
Stefan Kangas <stefankangas <at> gmail.com> writes:

> So, to give a somewhat contrived example, you can still break any
> mathematical calculation in Emacs with:
>
>     (setq float-pi 9)
>
> The only way to not have your code break in the face of that is to
> copy-paste the literal 3.141592... everywhere.

Yeah, but you can make the same argument for functions.  We allow
redefining `+' (and there's no warnings or nothing), but people don't
guard against that, either.

That said, we (in effect) have markup stating the intention for
`float-pi' to be a constant, so adding warnings when people redefine it
makes sense (because it's more likely that somebody does that as a
mistake instead of mistakenly redefining `+').




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.