Subject: bug#40671: [DOC] modify literal objects

From: Mattias Engdegård <[email-masked]>
Date: Fri, 24 Apr 2020 18:39:29 +0200

24 apr. 2020 kl. 04.36 skrev Richard Stallman <[email-masked]>:

> 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.