[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pcase bindings in patterns with complicated logic
From: |
Stefan Monnier |
Subject: |
Re: pcase bindings in patterns with complicated logic |
Date: |
Tue, 23 Jan 2024 14:59:54 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
> The `app` pattern is mostly for internal use when defining other
> patterns. It's key to the implementation of patterns like backquote so
> it's very important, but you'll rarely see it "out and about" in
> a `pcase` or `pcase-let` statement.
BTW, if you want help to understand the general design of Pcase, a good
read is that of the design of `match` for Racket:
Extensible Pattern Matching in an Extensible Language
Sam Tobin-Hochstadt, 2010
https://arxiv.org/abs/1106.2578
I didn't know about that `match` construct when I started Pcase (and now
that I actually pay attention to the publication date I realize that
maybe it's not because I missed it in my searches but because it came
out around the same time), but when I found it, I "realigned" Pcase to
be more like Racket's `match`. The implementation is not quite the same
because sadly our ELisp implementation doesn't handle (tail) calls quite
as efficiently as Racket, but there's a large overlap when it comes to
the exposed functionality.
Stefan
- Re: pcase bindings in patterns with complicated logic, (continued)
- Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/15
- Re: pcase bindings in patterns with complicated logic, Ihor Radchenko, 2024/01/16
- Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/17
- Re: pcase bindings in patterns with complicated logic, Ihor Radchenko, 2024/01/18
- Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/19
- Re: pcase bindings in patterns with complicated logic, Ihor Radchenko, 2024/01/20
- Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/20
- Re: pcase bindings in patterns with complicated logic, Ihor Radchenko, 2024/01/21
- Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/23
- Re: pcase bindings in patterns with complicated logic, Stefan Monnier, 2024/01/23
- Re: pcase bindings in patterns with complicated logic,
Stefan Monnier <=
Re: pcase bindings in patterns with complicated logic, Richard Stallman, 2024/01/14
Re: pcase bindings in patterns with complicated logic, Thierry Volpiatto, 2024/01/14