GNU bug report logs - #50136
28.0.50; A problem with rx-let expansion

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 20 Aug 2021 14:01:01 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias EngdegÄrd <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: 50136 <at> debbugs.gnu.org
Cc: Mattias EngdegÄrd <mattiase <at> acm.org>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#50136: 28.0.50; A problem with rx-let expansion
Date: Fri, 20 Aug 2021 16:50:01 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> #+begin_src emacs-lisp
> (rx-let ((scatter (s) (regex (mapconcat #'string (string-to-list s) ".*"))))
>   (rx (scatter "abc"))) ==> "a.*b.*c"
> #+end_src

AFAIU, the current approach doesn't allow to extend this with an
optional CHARS argument to specify with chars are allowed "in between"
(instead of "any").  The "&optional" keyword makes it barf.

And I can't actually "look" at the arguments to provide a conditional
replacement.  All I can do is to use `regex' to eval a constant
expression I specify (at run-time).  This seems a quite limiting
approach.  Something more macro-like would be appropriate IMO.

Michael.




This bug report was last modified 3 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.