GNU bug report logs -
#58513
describe-function should say that defconst variables are constant
Previous Next
Full log
View this message in rfc822 format
Richard Stallman <rms <at> gnu.org> writes:
> defconst has had a subtle meaning: "It is ok to expect, in certain
> limited ways, that the value will not be altered." Nothing more.
To my mind, the meaning is not subtle. On the contrary, it is both
clear and well-documented.
The manual (info "(elisp) Defining Variables") explains:
[defconst] defines SYMBOL as a value and initializes it. It informs
a person reading your code that SYMBOL has a standard global value,
established here, that should not be changed by the user or by other
programs.
From where I'm standing, this means that there is no practical
difference between a defconst and a defvar that Lisp code can rely on.
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.
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.