GNU bug report logs -
#49809
[PATCH] Add macro 'pcase-setq'
Previous Next
Reported by: Okam <okamsn <at> protonmail.com>
Date: Sun, 1 Aug 2021 17:21:01 UTC
Severity: normal
Tags: patch
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 49809 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen [2021-08-05 03:02:03] wrote:
> Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
>
>> Looks good.
>
> How much trouble would it be to provide a `setf' variant?
>
> A problem could be any syntax that is used for both pcase patterns and
> place expressions I guess.
Adding support for (setf (pcase PAT) VAL) is very easy to do without any
change to pcase or gv machinery.
Adding support for (setf PAT VAL), is a bit harder (and introduces
a risk because of the potential overlap, tho this risk is small: gv
places are normally defined for "eliminators" whereas pcase patterns are
usually defined for "constructors"), but still fairly easy.
Mixing pcase patterns and gv places as in
(setf `(,a . ,(aref V N)) EXP)
would be the most flexible option but I haven't thought much about how
hard it would be to implement, and I'm not sure it's worth the trouble.
Stefan
This bug report was last modified 3 years and 278 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.