Subject: Re: bug#62009: 29.0.60; Emacs crashes on setf symbol-name

From: Daniel Mendler <[email-masked]>
Date: Fri, 10 Mar 2023 14:08:44 +0100

On 3/10/23 13:57, Eli Zaretskii wrote:
>> Date: Fri, 10 Mar 2023 13:45:11 +0100
>> Cc: [email-masked], [email-masked], [email-masked],
>>  [email-masked], [email-masked], [email-masked]
>> From: Daniel Mendler <[email-masked]>
>>
>>> We disagree here, and this is a very fundamental disagreement, which
>>> basically means continuing this argument is pointless, since we have
>>> no common basis.
>>
>> I don't see that the disagreement is that strong. For example aset
>> signals an error if you try to access elements out of bounds.
>>
>> (aset "abc" 3 ?x) -> args-out-of-range
> 
> yes, because that's a frequent programmatic mistake.

Agree.

>> So there are clearly use cases where signaling an error is justified.
> 
> Of course.  It's just that the use case being discussed is not one of
> them.

I agree with you, that this is not a common mistake. But it is still a
mistake and we could easily protect the user from it.

This is a general question - do we want to prevent and catch most
programmer mistakes or not? You seem to lean on rather not catching some
errors which are rare and I am in favor of catching more errors if the
costs permit. In this case, the costs are small in my book (I cannot
look into your book and understand how you come to your conclusions).
Given that Robert already pointed out that objects can be marked as
read-only, all the necessary infrastructure is already in place, making
this a cheap change.

Catching more mistakes improves overall robustness of Emacs and
generally there are also security considerations which should be taken
into account. It may not matter in this case, but ensuring that the
Elisp runtime is memory safe as much as possible is a worthy goal.

>> In other cases you claim signaling an error is unjustified and a
>> crash is better.
> 
> I said nothing of the kind.  I said it was unjustified in the
> particular case which is being discussed here.

You clearly said that you object to any measures which fix this issue.
This means you prefer if Emacs crashes, instead of it signaling an error.

Daniel