[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the E
From: |
Clément Pit-Claudel |
Subject: |
Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources] |
Date: |
Mon, 29 Oct 2018 13:26:13 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 |
On 28/10/2018 19.09, Garreau, Alexandre wrote:
> the pattern look like what the data should be. adding “`” and “,”
> destroy this feature, because the pattern no longer looks like what
> is matched.
Maybe it's a matter of perspective? Adding "`" and "," is precisely what makes
the pattern look like the data: the invariant is that if you have a match,
repeating the pattern produces the original data.
Here's a concrete example: (pcase '(1 2 3 4) (`(,x ,y . ,z) `(,x ,y . ,z))) is
a no-op.
In other words, q-patterns are equations with multiple unknown variables
(holes). When you write a q-pattern, you're asking "what values should the
variables in this pattern take so that evaluating the pattern would return the
matched data?"
Clément.
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], (continued)
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Michael Heerdegen, 2018/10/28
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/28
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Michael Heerdegen, 2018/10/28
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/29
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Michael Heerdegen, 2018/10/29
- Re: pcase ` meaning, Garreau\, Alexandre, 2018/10/29
- Re: pcase ` meaning, Michael Heerdegen, 2018/10/29
- Re: pcase ` meaning, Garreau\, Alexandre, 2018/10/29
- Re: pcase ` meaning, Michael Heerdegen, 2018/10/29
- Re: pcase ` meaning, Yuri Khan, 2018/10/30
- Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources],
Clément Pit-Claudel <=
- Re: pcase ` meaning, Garreau\, Alexandre, 2018/10/29
- Re: pcase ` meaning, Stefan Monnier, 2018/10/30
- Re: pcase ` meaning, Garreau\, Alexandre, 2018/10/31
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/28
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/29
- What `case' have done you? [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Garreau\, Alexandre, 2018/10/29
- Re: What `case' have done you? [Was: Re: Replace trivial pcase occurrences in the Emacs sources], Michael Heerdegen, 2018/10/29
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/30
- Re: Replace trivial pcase occurrences in the Emacs sources, Michael Heerdegen, 2018/10/30
- Re: Replace trivial pcase occurrences in the Emacs sources, Eli Zaretskii, 2018/10/30