emacs-devel
[Top][All Lists]
Advanced

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

Re: master ea93326: Add `union' and `intersection' to rx (bug#37849)


From: Mattias Engdegård
Subject: Re: master ea93326: Add `union' and `intersection' to rx (bug#37849)
Date: Fri, 13 Dec 2019 18:03:14 +0100

13 dec. 2019 kl. 14.55 skrev Stefan Monnier <address@hidden>:

> BTW, if you like the fact that the old system made it clear&sure that
> the result is optimized, then I think it should be introduced as
> a syntax like
> 
>    (any (union "a-z" (intersection "0-9" "6-a")))


An interesting suggestion, but exactly how would that model work? Consider:

 (rx-define ident-chars (any "a-z0-9"))
 (rx-define op-chars (any "+*/" ?-)

To form the union of the two, 'any' needs to be allowed inside 'union':

 (any (union ident-chars op-chars))

Then 'any' and 'union' are effectively synonyms. I'm not sure this is better 
than just using 'or' for union.

---

Speaking of 'or', we still haven't figured out what to do about regexp-opt in 
rx. Currently, the answer is something like
(eval (regexp-opt STRINGS)), which isn't ideal.




reply via email to

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