bug-gnulib
[Top][All Lists]
Advanced

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

Re: new module 'regex-quote'


From: Bruno Haible
Subject: Re: new module 'regex-quote'
Date: Mon, 20 Sep 2010 20:21:22 +0200
User-agent: KMail/1.9.9

Eric,

> rather than adding a new flag bit, what about providing 
> regex_quote_anchored as a wrapper that provides the anchors, so that the 
> end user can choose between the one-liners of regex_quote or 
> regex_quote_anchored?

It's the same argumentation: It's already easy enough to do this in C, with
1 to 5 straightforward lines of code.

When you provide an API, where to stop? When an API provides two similar
functionalities, where one can be coded using the other and 1-5 extra lines of
code, one of them is redundant.
- Once we have memcpy, is it worth having strcpy and stpcpy? Normally no. But
  there are so many uses of memcpy that adding strcpy and stpcpy was worthwhile.
- Once we have strpbrk, is it worth having strcspn? I would say no. strcspn is
  only there because it predates strpbrk.
- Once we have regex_quote, regex_quote_anchored is redundant.

The drawback of a large API is that it's harder to keep in memory.

Bruno



reply via email to

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