GNU bug report logs - #72328
[PATCH] Nested backquote in pcase

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Sun, 28 Jul 2024 01:06:02 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 72328 <at> debbugs.gnu.org (full text, mbox):

From: Thuna <thuna.cing <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, monnier <at> iro.umontreal.ca, 72328 <at> debbugs.gnu.org
Subject: Re: bug#72328: [PATCH] Nested backquote in pcase
Date: Mon, 05 Aug 2024 21:32:43 +0200
>> Note that I do not believe that there are no people who would be
>> effected by this, positively or negatively.
>
> We've learned from bitter experience that such arguments are usually
> false.  IOW, we don't really know enough to make such assertions.

I think there is a misunderstanding.  I am not saying that there isn't
anyone who would be effected by this, it is the opposite.  I understand
that this will effect people, and I agree that at minimum there needs to
be a decent period where the current behavior is maintained but marked
as obsolete.  An indefinite feature-freeze is where I have a problem.

>> 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)))
>
> Thanks, now you just need to explain why you needed this code and what
> did its caller do to require this.

I do not understand what you are asking for.  Whether `macroexp-null'
should exist or not, what it is trying to do should be fairly clear, so
should the way in which it benefits from the changed behavior.

I also cannot provide any justification for this patch above and beyond
what I have already mentioned in my initial message: This patch
establishes a symmetry between pcase's backquote pattern and quasiquote,
which allows trivially matching against the result of a quasiquote form.

I would appreciate it if you would state your opinion on this patch,
putting aside concerns of backwards compatibility for a moment.  I am
working under the assumption that this is an improvement and is
desirable, yet I have not yet heard from you or Stefan as to whether you
see it that way or not.




This bug report was last modified 236 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.