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

Re: english names for symbolic SREs

This page is part of the web mail archives of SRFI 115 from before July 7th, 2015. The new archives for SRFI 115 contain all messages, not just those from before July 7th, 2015.



On Tue, Nov 26, 2013 at 01:13:31PM -0800, Michael Montague wrote:
> Briefly looking through the first 16 or so implementations listed on 
> http://trac.sacrideo.us/wg/wiki/SchemeImplementationReleases, it 
> appeared to me that only Chicken and Chibi provide SRE regular 
> expressions.

What about the original SCSH?  And there's an attempt at re-porting
SCSH to plain Scheme48, and a port of SCSH to Guile.  Finally,
Irregex and this SRFI's reference implementation are portable
implementations which work ~everywhere.

Regarding the match result objects: there's also this implementation:
http://www.omnigia.com/scheme/scsh-regexp/

It was a start of porting the SCSH regex stuff, but it never got
finished.  There is currently no SRE syntax support for it, but the
regex API (which uses these match result objects) is there.

> This SRFI is going to break people's code no matter how it comes out, 
> particularly if it becomes part of R7RS-large.

That's just silly: any regex implementation can use this as its engine,
and people can keep using PCRE as input.  CHICKEN's "regex" egg does this
to maintain backwards compatibility with the old PCRE-based regex system.
Most users have switched to irregex in the meanwhile, though.

> My opinion: SREs are a mutant love child of Scheme and Perl. To 
> understand them you need to understand Scheme and PCREs.

For the common regex operators, the symbols are pretty well-known.
And for the really weird ones (non-submatch grouping, lookahead etc)
the syntax is already friendlier.  It's a sweet spot of readability
and terseness.

> I think SREs are cool. I don't think that Olin Shivers went far enough 
> into the world of Scheme with the syntax. My proposed syntax would make 
> SREs easier to learn without knowing PCREs first and it would make it 
> easier for casual users of SREs to remember the syntax.

You *would* be breaking backwards compat with that.

Cheers,
Peter
-- 
http://www.more-magic.net