emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instead of pcase


From: Stefan Kangas
Subject: Re: Instead of pcase
Date: Mon, 8 Jan 2024 21:36:18 -0800

João Távora <joaotavora@gmail.com> writes:

> On Fri, Dec 1, 2023 at 6:28 PM Dmitry Gutov <dmitry@gutov.dev> wrote:
>
>> That just reaffirms my understanding that the main problem with 'pcase'
>> that we have is documentation. The nodes are written very bottom-up,
>> whereas what's really needed for someone to understand the core usage,
>> would look more like the first half of the node "Destructuring with
>> ‘pcase’ Patterns".
>
> +1
>
> Instead of "11.4 Pattern-Matching Conditional", that section could
> be called "Pcase and friends" or "The pcase family of macros family".
>
> Though it is original use of pcase, pcase conditionals are just one
> of the things you can do with it, and in my recent experience, not
> necessarily the most common or useful one.  Also 'pcase-let' is
> probably easier to understand than 'pcase', as it only does
> destructuring and binding whereas the other macros do that and something
> more on top.
>
> Besides renaming, that section could start with a 11.4.1 "quick-start"
> with some brief explanation about how pcase relates to backquote-and-tick
> and with an example for 'pcase-let', not unlike the one that surfaced here.
>
> If space allows,  an example for 'pcase' that introduces the conditional
> macro can be added.

Please reformat this also as documentation patches and send to the bug
tracker.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]