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

Re: english names for symbolic SREs



On Sat, Nov 30, 2013 at 11:56 PM, Michael Montague <mikemon@xxxxxxxxx> wrote:
On 11/27/2013 7:37 AM, John Cowan wrote:
> Alex Shinn scripsit:
>
>> It was John who insisted that the names be added, and John
>> who came up with most of the new names, so I'm assuming
>> he genuinely wants them.
> I do, though I didn't come up with the idea and in fact was initially
> against having more than one way to do it, but you convinced me otherwise.
> I think the long names are more self-documenting, more Schemey, and
> will make SREs more accessible to people who find string REs an
> abomination of the outer darkness.

Hypothetically, lets say that this SRFI specifies a new regular
_expression_ syntax called NRE. It should be straightforward to transform
SREs into NREs. The existing SRE implementations (IrRegex and SCSH) can
provide a procedure sre->nre which people with existing SREs can use and
their code is not gratuitously left behind.

The problem with providing both short names and long names is that when
I write SREs I can just use the long names, but when I read other
peoples SREs, then I potentially still need to know both.

The short names have been in use for over a decade.
They are much friendlier to people used to PCREs, which
honestly is our primary target.  Brevity is thus an
important feature since people will compare the length
of these to PCREs.  With the short names there are even
cases where SREs are shorter than PCRE, for example

  `(:,x(*,y))

versus

  "(?:\Q$x\E(?:\Q$y\E)*)"

Moreover, brevity is inherently important because people
will type these interactively into editors to search, and here
the number of keystrokes really matters.

If you think having two names is a bad idea we can still
remove the long names.

-- 
Alex