unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: "Diogo F. S. Ramos" <dfsr@riseup.net>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH 2/2] Add reference to the lack of "non-greedy" variants
Date: Fri, 28 Mar 2014 20:25:46 +0100	[thread overview]
Message-ID: <87zjka3z2d.fsf@taylan.uni.cx> (raw)
In-Reply-To: <87ppl8b8xw.fsf@nebulosa.milkyway> (Diogo F. S. Ramos's message of "Thu, 27 Mar 2014 00:46:03 -0300")

"Diogo F. S. Ramos" <dfsr@riseup.net> 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	other threads:[~2014-03-28 19:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  3:27 [PATCH 1/2] Remove link to Emacs' regexp syntax Diogo F. S. Ramos
2014-03-26  3:27 ` [PATCH 2/2] Add reference to the lack of "non-greedy" variants Diogo F. S. Ramos
2014-03-26 21:08   ` Taylan Ulrich Bayırlı/Kammer
2014-03-27  3:46     ` Diogo F. S. Ramos
2014-03-28 19:25       ` Taylan Ulrich Bayırlı/Kammer [this message]
2014-04-15 11:38         ` Diogo F. S. Ramos
2016-06-19 15:41   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjka3z2d.fsf@taylan.uni.cx \
    --to=taylanbayirli@gmail.com \
    --cc=dfsr@riseup.net \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).