[Top][All Lists]

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

Re: Code for cond*

From: Stefan Monnier
Subject: Re: Code for cond*
Date: Wed, 24 Jan 2024 12:08:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>> returns the same `(foo moo loo . boo)`, so there is not a unique way for
>> a pattern like `(,@list-var . ,other) to match a given list.
>> That's a large part of the reason why ,@ is not supported in Pcase's
>> backquote patterns.
> Not a unique way without a policy, but could it not take the largest
> possible list at that position, ala regexp greedy matching?

Of course, if you absolutely want that feature, you can define a meaning
for it.  But it does make it somewhat different in nature to the rest of
the patterns.  Another difference is that it will allocate new objects
rather than just select fields from the object under scrutiny.

BTW, this is all implementable right now without any change to
`pcase.el`: just write the corresponding `pcase-defmacro` :-)


reply via email to

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