[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58513: describe-function should say that defconst variables are cons
From: |
Stefan Kangas |
Subject: |
bug#58513: describe-function should say that defconst variables are constant |
Date: |
Mon, 17 Oct 2022 05:41:09 +0000 |
Richard Stallman <rms@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.
- bug#58513: describe-function should say that defconst variables are constant, (continued)
- bug#58513: describe-function should say that defconst variables are constant, Phil Sainty, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Lars Ingebrigtsen, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Stefan Kangas, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Lars Ingebrigtsen, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Stefan Monnier, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Lars Ingebrigtsen, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Stefan Monnier, 2022/10/14
- bug#58513: describe-function should say that defconst variables are constant, Lars Ingebrigtsen, 2022/10/15
- bug#58513: describe-function should say that defconst variables are constant, Richard Stallman, 2022/10/16
- bug#58513: describe-function should say that defconst variables are constant, Drew Adams, 2022/10/16
- bug#58513: describe-function should say that defconst variables are constant,
Stefan Kangas <=
- bug#58513: describe-function should say that defconst variables are constant, Lars Ingebrigtsen, 2022/10/17
- bug#58513: describe-function should say that defconst variables are constant, Stefan Kangas, 2022/10/15
- bug#58513: describe-function should say that defconst variables are constant, Stefan Monnier, 2022/10/15