[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase ` meaning
From: |
Michael Heerdegen |
Subject: |
Re: pcase ` meaning |
Date: |
Tue, 30 Oct 2018 00:57:39 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
"Garreau, Alexandre" <address@hidden> writes:
> > You mean like (pred (equal val))?
>
> Oh indeed! Still that defeat the purpose of pattern matching by
> requiring non-pattern matching stuff.
What in that pattern is non-pattern matching stuff?
> The fact pcase is not strictly treating ` as standard lisp’s reader does
> is only *adding* the the already existing confusion normal and standard
> ` introduces in lisp.
` is a normal macro, it has nothing to do with the reader. Apart from
the ` reader macro, which pcase doesn't touch at all.
What it does is to give ` different semantics inside patterns. Like
your `list' pattern gives new semantics to the symbol `list'. Oh my.
> > For understanding the definition above note that ``' (synonymous for
> > `backquote') is a (very normal) macro accepting one argument STRUCTURE,
> > whereby we also have an abbreviating reader syntax
> > `STRUCTURE == (` STRUCTURE). We also have the reader syntax
> > ,THING == (, THING).
>
> Indeed you’re right, but that doesn’t automagically explain to me how
> does exactely work the “,” macro, as it stays context dependant, not
> trivial, and to me, “,” meant either “eval” or “undo ‘`’” (the later is
> nearer to the meaning used in pcase btw).
(, is not a macro, btw) Well, in pcase patterns it "means" something
different. As `and' means something different in `rx'.
You very often say that you expected something different. I dunno what
I first expected, I read the docs to learn pcase, and it took 5 minutes.
I think we can agree that we disagree - I just don't share your
opinion. The thing is designed in a way that it matches how some, but
not all people, like to think about pattern matching.
Michael.
- How other pattern-matching lisps do [Was: Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources]], (continued)
- Re: How other pattern-matching lisps do [Was: 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], 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 <=
- 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, 2018/10/29
- 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