GNU bug report logs -
#37440
[PATCH] New rx implementation with extension constructs
Previous Next
Reported by: Mattias Engdegård <mattiase <at> acm.org>
Date: Tue, 17 Sep 2019 12:51:02 UTC
Severity: wishlist
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#37440: [PATCH] New rx implementation with extension constructs
which was filed against the emacs package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 37440 <at> debbugs.gnu.org.
--
37440: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37440
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Thanks, I installed those patches into master and am closing the bug report.
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
[Continuing from https://lists.gnu.org/archive/html/emacs-devel/2019-09/msg00048.html]
Here is a new rx implementation (faster, easier to work with, fewer bugs, better tests), and, as a separate patch, an rx extension mechanism adding the macros `rx-define', `rx-let' and `rx-let-eval'.
The first patch is a ground-up rewrite of rx. It should be completely compatible.
The second patch adds
(rx-define NAME [ARGS] RX)
(rx-let ((NAME [ARGS] RX) ...) BODY)
(rx-let-eval ((NAME [ARGS] RX) ...) BODY)
as mentioned in the emacs-devel thread earlier. Additions to the manual are included.
Although I believe this to be a consistent and useful design that could be used as-is, some points worth thinking about are:
* Allow for multiple RXs in the definitions, making an implicit (seq ...). This could be done with the Schemeish syntax
(rx-define NAME RX...)
(rx-define (NAME ARGS...) RX...)
which is quite readable as "definition mirrors use". Should then the &rest parameter be declared using a dotted list, as
(rx-define (NAME ARG1 ARG2 . ARG-REST) RX...)
?
* There is some disagreement regarding whether function-like definitions should be standard Lisp expressions instead of the restricted substitution-based macros in this patch, as in
(rx-define whole (x) `(seq bos ,x eos))
I believe the usability of the chosen design is better, but see the point of not reinventing the wheel.
* Not entirely satisfied with the name `rx-let-eval', but unless someone comes up with something better, it stands.
[0001-New-rx-implementation.patch (application/octet-stream, attachment)]
[0002-Add-rx-extension-mechanism.patch (application/octet-stream, attachment)]
This bug report was last modified 5 years and 234 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.