emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How other pattern-matching lisps do [Was: Re: pcase ` meaning [Was:


From: Stefan Monnier
Subject: Re: How other pattern-matching lisps do [Was: Re: pcase ` meaning [Was: Re: Replace trivial pcase occurrences in the Emacs sources]]
Date: Sun, 28 Oct 2018 09:44:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Okay, so I went to search what is done in other pattern matching lisp
> form.

You missed Racket's `match` (https://docs.racket-lang.org/reference/match.html)

Incidentally, I also missed it when I did the same search you did before
embarking on the design and implementation of pcase.  I later found
Racket's `match` which was pretty close to the original design of pcase,
but showed me how to add `pcase-defmacro` (mostly by adding the `app`
pattern), which led to the "new pcase" where ` is a macro (and where
' was added for that macro to have something to expand to).

The current `pcase` is pretty close to Racket's `match`.  The main
missing functionality is the negation, which Racket solves "easily"
because its underlying language handles lambda much more efficiently
(i.e. the code generated by `match` would work very poorly in Elisp
unless we significantly improved the byte-compiler's handling of
funcall).


        Stefan




reply via email to

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