all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thuna <thuna.cing@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael_heerdegen@web.de, monnier@iro.umontreal.ca,
	72328@debbugs.gnu.org
Subject: bug#72328: [PATCH] Nested backquote in pcase
Date: Tue, 06 Aug 2024 15:09:57 +0200	[thread overview]
Message-ID: <871q31ztju.fsf@gmail.com> (raw)
In-Reply-To: <86o765q4yo.fsf@gnu.org>

>> >> 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.
>
> How do you envision making such a behavior change in a way that will
> leave the current behavior still maintained (and obsolete)?

In the patch I provided the check for `(<= depth 0)' can be moved out of
the conditions and into the branches as

   `(unless (<= depth 0) (macroexp-warn-and-return ...))'

and it should work identical to how it does now.  We can also
semi-support the new behavior at the same time by making it so that if
there are nested commas in the pattern it uses the new behavior.  This
should not cause any backwards-incompatibility because a nested comma in
a pcase is currently just an error.  If this is something that would be
of interest I can look into providing a patch for it.

>> An indefinite feature-freeze is where I have a problem.
>
> Disagreeing with a specific change is not tantamount to an indefinite
> feature-freeze.  It is quite possible that someone will come up with a
> different idea of a change, which we will be able to reconcile easier
> with the previous behavior.

As long as the goal of such a change is to establish symmetry with
quasiquote, you can not reconcile the fact that the current behavior and
the expected behavior on the pattern ``,foo are incompatible.

>> >> (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 asked to explain _why_ you need this.  Risking to say the obvious, a
> program exists to do some job, and a function like the above is
> therefore part of some larger job.  We are asking you to describe the
> higher-level context, which we could then use to try to decide whether
> the need is important enough to justify the backward-incompatible
> change.

And I am saying that that broader context of this example is not
meaningful in any way; I provided it solely because of the ask for a
real-life use-case.  I would appreciate not being put in a situation
where I must defend multiple patches (one not even proposed) at once.

Whether this new behavior is or will be used in emacs does not matter.
I am not proposing this change to make further patches more convenient,
but because I believe that it is the correct way for pcase to behave.

>> 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.
>
> We would like to hear reasons for wanting this.

At the risk of repeating myself: (pcase ``,foo (``,foo foo)) should not
return (\, foo).  The current behavior is unintuitive and makes patterns
actually matching against quasiquote forms essentially write-only.

>> 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.
> I believe Stefan did say that.  Me, my only stake here is the concern
> of backwards compatibility, which is why I'm talking only about that.

I don't see how we can discuss whether this patch has enough benefits to
clear the hurdle of backwards-incompatibility if you are not willing to
engage with the discussion of what this patch's benefits *are* to begin
with.





  reply	other threads:[~2024-08-06 13:09 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-28  0:40 bug#72328: [PATCH] Nested backquote in pcase Thuna
2024-07-28 14:52 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-28 15:51   ` Thuna
2024-07-28 16:02     ` Eli Zaretskii
2024-07-28 16:20       ` Thuna
2024-07-29 16:03     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 16:45       ` Eli Zaretskii
2024-07-30  7:45         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-03  0:07           ` Thuna
2024-08-03  5:59             ` Eli Zaretskii
2024-08-03 13:22               ` Thuna
2024-08-04 17:10                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-04 21:27                   ` Thuna
2024-08-05 11:52                     ` Eli Zaretskii
2024-08-05 19:32                       ` Thuna
2024-08-06  8:21                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-06 11:13                         ` Eli Zaretskii
2024-08-06 13:09                           ` Thuna [this message]
2024-08-07  3:33                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-07 11:53                               ` Eli Zaretskii
2024-08-07 17:34                               ` Thuna
2024-08-08  5:57                                 ` Eli Zaretskii
2024-08-23  3:25                                   ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 14:49                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 16:04                                       ` Eli Zaretskii
2024-08-23 19:11                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 19:29                                           ` Eli Zaretskii
2024-09-07  7:18                                             ` Eli Zaretskii
2024-09-07 12:24                                               ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 20:19                                         ` Thuna
2024-07-29 17:43       ` Thuna
2024-07-29 19:05         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 20:45         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-07-29 20:59           ` Thuna
2024-07-30 17:53             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871q31ztju.fsf@gmail.com \
    --to=thuna.cing@gmail.com \
    --cc=72328@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.