emacs-devel
[Top][All Lists]
Advanced

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

Re: Make regexp handling more regular


From: Stefan Kangas
Subject: Re: Make regexp handling more regular
Date: Wed, 2 Dec 2020 05:12:25 -0600

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So my idle shower thought for the day is: Is there any reasonable path
> forward that the Emacs Lisp language could take here?
>
> Well, we obviously can't alter functions like `string-match' and
> `re-search-forward' -- they have well-defined semantics, and we can't
> make them return a match object.  But we could make a new set of
> functions that are more, er, functional.

I like the idea of adding an entirely new built-in API based on the
current state of the art.  I would begin such a project by looking into
what other Lisps are doing, such as CL, Clojure, Guile and Racket.  Why
shouldn't Emacs Lisp be best-in-class?

As for naming, how about just using a short prefix such as "re-"?
AFAICT, we currently have only five functions using that prefix.

Tangentially, I have always been wondering if its feasible to add a new
regular expression type to `read' where you don't have to incessantly
double quote all special characters.  (One could take inspiration from
Python, for example, which adds an "r" character to strings to turn them
into regexps: r"regexp".)



reply via email to

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