guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] Add reference to the lack of "non-greedy" variants


From: Taylan Ulrich Bayırlı /Kammer
Subject: Re: [PATCH 2/2] Add reference to the lack of "non-greedy" variants
Date: Fri, 28 Mar 2014 20:25:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix)

"Diogo F. S. Ramos" <address@hidden> writes:

> The documentation is already pointing out that some characters are
> special, so adding the "non-greedy" observation is not special in this
> case and IMO it's an expected feature from regexps.

I'd rather say that *both* the mention of those characters, and the
mention of non-greediness being unsupported, are special cases. :-)

Maybe we should just remove both and only provide a link to the
specification of POSIX ERE, or clarify that "POSIX extended regular
expressions" are a specific type of regexp (and not the possible
misinterpretation which is "an (ad-hoc) extended version of POSIX
regexps") so that users can search for documentation on them by
themselves.

(Many Unix-like systems have a man-page for regexps; IIRC GNU+Linux
distros tend to have a "regex" man-page which describe both POSIX BRE
(Basic RE) and ERE, and I see the three BSDs all have an "re_format"
man-page (linked to by the regex(3) man-page) which also describes those
two.)

By the way I see that the mention of POSIX ERE happens only in section
6.15.1 and not directly in the intro 6.15, which instead misleadingly
links to Emacs regexps.

Also, I never expect non-greediness support from regexps, because I've
"grown up" as a Unix-like OS user and shell scripter, so it's POSIX BRE
(sed, grep) and ERE (grep, awk) for me.  This probably goes for many
people.

> Your observation makes me think I didn't go far enough.  If users
> expect Perl regexps, we should warn them that Guile's is not.
>
> Ultimately, I think Guile should document its own regexp syntax.

Like I said, "POSIX ERE" is an absolute specification.  We might still
want to distribute a copy of it so users can access it more easily, but
on the other hand the manual implies that the supported regexp format
actually depends on what regexp library Guile was compiled with.  (Or am
I misinterpreting paragraph 2 of 6.15 plus paragraph 1 of 6.15.1 which
says "by default"?)

My proposal would be to remove the Emacs link in 6.15, add a paragraph
that has a sole, clear mention of POSIX ERE, and remove the first
paragraph of 6.15.1, or keep its first sentence because it's crucial
information so the redundancy with the preceding section doesn't hurt.

Taylan



reply via email to

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