Subject: Re: bug#72328: [PATCH] Nested backquote in pcase

From: Thuna <[email-masked]>
Date: Sun, 04 Aug 2024 23:27:52 +0200

>>> Thanks, but I think Stefan meant to say that we would need real-life
>>> use cases to change the current behavior.  So if there are no such
>>> cases, it makes the decision less likely.
>>
>> I don't see how Stefan's message could be interpreted that way.
>
> FWIW, I interpreted it that way too.

My understaning is that the utility of going through use cases for or
against the new behavior is to determine whether it would be an
improvement or not.  The absence of any such use cases does not mean
anything in either direction, but simply that this is not a usable tool.

Furthermore, just intuitively, why would the absence of users of a
feature be a reason to not improve it?  If the contention is that this
is not an improvement then I would rather that argument be made instead.

Note that I do not believe that there are no people who would be
effected by this, positively or negatively.  However, my search through
melpa shows that producing such examples will be difficult and this
thread will likely not see many (if any) replies, aside from the one
shared by Michael and the one I provide below.

>> If almost no code is effected by a change then whether to apply that
>> change or not should depend solely on whether it is considered an
>> improvement, even if theoretically.
>
> From what I understand, coming to decisions as a maintainer is not that
> simple.  And Stefan had reasons to choose the current implementation.

The stated reasoning was that implementational simplicity was valued
over symmetry with backquote.  There is an argument to be made that the
current behavior, though at odds with backquote, is preferable in the
context of pcase.  Such an argument has yet to have been made, however.

> So this is a relevant question and trying to answer it would probably
> help to come to an decision.

Very well.  In that case, here's the original case which prompted me to
look into how pcase's backquote behaves:

(defun macroexp-null (exp)
  "Return non-nil if EXP will always evaluate to nil.
This form does not take non-local exits or side-effects into account."
  (pcase exp
    ((or 'nil ''nil '#'nil '`nil ``,,(pred macroexp-null))
     t)))

which without this change would read as:

(defun macroexp-null (exp)
  "Return non-nil if EXP will always evaluate to nil.
This form does not take non-local exits or side-effects into account."
  (pcase exp
    ((or 'nil ''nil '#'nil '`nil
         `(,'\` (,'\, ,(pred macroexp-null))))
     t)))