[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#6985: rx patterns don't compose
From: |
Stefan Monnier |
Subject: |
bug#6985: rx patterns don't compose |
Date: |
Sun, 05 Sep 2010 09:22:04 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> It's not possible to do this currently:
> (defconst foo-re (rx "abc"))
> (defconst bar-re (rx (* (what-goes-here? foo-re)))
(defconst foo-re (rx "abc"))
(defconst bar-re `(rx (* (regexp ,foo-re)))
> in any sensible way. This won't work
> (defconst bar-re (rx (* (regexp foo-re))))
> because regexp always expects a string.
> This won't work, because eval always quotes its argument:
> (defconst bar-re (rx (* (eval foo-re))))
> I propose allowing regexp to accept a symbol as well as a string, and
> using that symbol's value literally. Alternatively, rx could provide an
> eval-unquoted facility. Or both.
eval-unquoted sounds OK
Stefan