emacs-devel
[Top][All Lists]
Advanced

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

Re: Can't compile `or' pcase pattern


From: Stefan Monnier
Subject: Re: Can't compile `or' pcase pattern
Date: Thu, 11 May 2017 22:29:56 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> #+begin_src emacs-lisp
> (el-search--matcher
>  '(or (l ^ defstruct object)
>       (l ^ (and (symbol "def") (or (pred macrop) (pred special-form-p))) 
> object)))
> #+end_src

Looking at the definition of `l` I think you're pushing pcase a bit
further than it can go.

A bit like a DFA representation of a regexp can explode, a pcase's
expansion can explode in some cases, and your `l` has all the tools
needed to triggger such explosions.

Maybe you can reduce the pain, by looking at the expansion and
trying to see how pcase-mutually-exclusive-p could be improved to get
a better result.


        Stefan




reply via email to

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