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: Yuan Fu
Subject: Re: Make regexp handling more regular
Date: Wed, 2 Dec 2020 12:45:23 -0500


> On Dec 2, 2020, at 12:17 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> 
>> Naming is, of course, the most difficult problem here.
> 
> I agree that it might be worth looking at what other languages do.
> But we could also just follow "traditional regexp" libraries's
> suggestions for naming and go with something like:
> 
>    (re-match  REGEXP &optional OBJECT START END)
>    (re-search REGEXP &optional OBJECT START END)
> 
> [ the first being like `looking-at` (i.e. an "anchored" match).  ]

Whatever the name is, we should make sure they don’t introduce even more 
confusion on top of the already confusing names.

re-search-forward
re-search-backward
re-search
re-match

It’s hard to see what each function does from a glance, IMO. That’s not 
counting string regexp functions.


> 
> I'd also suggest to make those functions accept other arguments than
> strings for REGEXP, i.e. to make them into generic functions.

It would be cool if these functions accept rx forms.

Yuan


reply via email to

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