emacs-devel
[Top][All Lists]
Advanced

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

Re: "Raw" string literals for elisp


From: Mattias Engdegård
Subject: Re: "Raw" string literals for elisp
Date: Wed, 8 Sep 2021 17:27:58 +0200

8 sep. 2021 kl. 16.31 skrev Anna Glasgall <anna@crossproduct.net>:

> Cards on the table here: yes, regexes are 99.999% of the motivation
> here

Elisp actually has a much better regexp syntax than most other languages:

> "\\(\\\\\\\\\\)\\(?:\\(\\\\\\\\\\)\\|\\((\\(?:\\?[0-9]*:\\)?\\|[|)]\\)\\)"

Today that would be written

(rx (group "\\\\")
    (or (group "\\\\")
        (group
         (or (seq "("
                  (? "?" (* digit) ":"))
             (in ")|")))))

which is much more readable and maintainable and less error-prone than what you 
would get with a new string syntax.




reply via email to

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