bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40671: [DOC] modify literal objects


From: Mattias Engdegård
Subject: bug#40671: [DOC] modify literal objects
Date: Fri, 24 Apr 2020 18:39:29 +0200

24 apr. 2020 kl. 04.36 skrev Richard Stallman <rms@gnu.org>:

> It seems strange to use the terms "constant" and "mutable" to describe
> whether modifying its contents is something you had better avoid.
> I think people will find that terminology confusing.  Normally
> "mutable" means that you CAN change it, not that it is OK to change it.

That is an interesting point. What is the difference between CANNOT and SHOULD 
NOT, operationally? To the user, nothing; there is no gain from disobeying our 
advice. Implementation-wise, it's whether there are strong checks or not. (For 
example, in C you should not read from already freed memory, but there is no 
mechanism actually preventing you from doing so.)

It's useful to have the option to add strong checks, so that (setcar '(1 . 2) 
3) throws an error. Then, what used to be SHOULD NOT turns into CANNOT, but the 
attentive user has no reason to change behaviour.

Of course the real world is messy and people sometimes have code that breaks 
the rules but still seem to work. There would need to be a transition period, 
and a switch to run in a permissive mode.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]