[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.
- Re: "Raw" string literals for elisp, (continued)
- Re: "Raw" string literals for elisp, Lars Ingebrigtsen, 2021/09/08
- Re: "Raw" string literals for elisp, Alan Mackenzie, 2021/09/08
- Re: "Raw" string literals for elisp, Adam Porter, 2021/09/08
- Re: "Raw" string literals for elisp, Stefan Monnier, 2021/09/08
- Re: "Raw" string literals for elisp, Philip Kaludercic, 2021/09/08
- Re: "Raw" string literals for elisp, Alan Mackenzie, 2021/09/08
- Re: "Raw" string literals for elisp, Stefan Kangas, 2021/09/08
- Re: "Raw" string literals for elisp, Philip Kaludercic, 2021/09/08
- Re: "Raw" string literals for elisp, tomas, 2021/09/09