bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#36496: [PATCH] Describe the rx notation in the lisp manual


From: Drew Adams
Subject: bug#36496: [PATCH] Describe the rx notation in the lisp manual
Date: Sun, 7 Jul 2019 00:36:24 +0000 (UTC)

>   > I cannot answer the question without knowing which practical factors
>   > made rx inconvenient in the past.  Where can one find this
>   > information?
> 
> I don't know.  I think people discussed it in the
> past -- perhaps on emacs-devel.  I don't remember details.
> 
> What's clear is that rx didn't replace regexp syntax in the past.
> There had to be reasons.

I don't want to sidetrack this thread.  But one of
the things mentioned in some previous threads about
`rx' was that some people (including me) thought it
would be great if you could invoke a command on a
regexp (e.g. a regexp string in code) and have an
equivalent `rx' expression pop up, for inspection
and understanding.

A regexp string can be very concise (advantage),
even if obtuse (disadvantage).  Much of the time one
doesn't need to dig into the content of the regexp.
It would be nice to be able to have only the result
of `rx' in the code and be able to get its `rx'
expression on demand.

In sum, I'd say that one advantage of a regexp is
its concision.  But when you need or want to grok
it it's good to be able to get its `rx' sexp.

With such a feature people could use `rx' or its
result in code, au choix.  And they could see the
`rx' equivalent for a regexp on demand.

This is orthogonal to having good doc for `rx'.
I mention it only because the question came up of
disadvantages of `rx' (reasons why it might not
replace a regexp).

(Another reason, if it's true, would be if there
are some regexp constructs that `rx' cannot
handle/reproduce.)





reply via email to

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