emacs-devel
[Top][All Lists]
Advanced

[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.



reply via email to

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