Subject: Re: bug#49809: [PATCH] Add macro 'pcase-setq'

From: Stefan Monnier <[email-masked]>
Date: Fri, 06 Aug 2021 00:07:07 -0400

> Yes, that's what I had in mind.  Also for plain `pcase' I guess.
> Maybe we could use an explicit (gv PLACE) pattern that is like SYMBOL
> but compares/binds/sets the PLACE instead of the SYMBOL.

I don't see how that would work.  `pcase` is designed to test and
extract data.  It then makes that data available by giving it names
(local variables).

The SYMBOL pattern doesn't "set" that variable, it creates a fresh new
one, but that operation doesn't exist for gv places (the only thing we
can do there is get and set).

It would make sense for `pcase-setq`, of course, but for `pcase` I just
don't see how that would work (unless you'd want it to work like
`cl-letf`, but that's like dynamically scoped let so I think you'd
be hard pressed to find enough compelling use cases to justify it).

        Stefan