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

Re: english names for symbolic SREs



On Fri, Nov 29, 2013 at 12:35 AM, Michael Montague <mikemon@xxxxxxxxx> wrote:

I have an alternative suggestion for english names. After thinking about it lots more, I am not sure that there needs to be a one-to-one match between short names and english names, just the same expressive power.

How about 'maybe', 'greedy', and 'non-greedy':

? maybe
* (greedy 0 <sre> ...)
+ (greedy 1 <sre> ...)
>= (greedy <n> <sre> ...)
= (greedy <n> <n> <sre> ...)
** (greedy <n> <m> <sre> ...)
?? (non-greedy 0 1 <sre> ...)
*? (non-greedy 0 <sre> ...)
**? (non-greedy <n> <m> <sre> ...)

I prefer keeping the 1:1 correspondence between short names
and English names.  I also dislike the behavior changing on
the type and number of leading arguments.  If you want to
avoid lots of new names I suggest only providing names for
the ** case:

  (repeated <n> <m> <sre> ...)
  (non-greedy-repeated <n> <m> <sre> ...)

where the special cases can simply be written as their
existing ** equivalents:

? (repeated 0 1 <sre> ...)
* (repeated 0 #f <sre> ...)
+ (repeated 1 #f <sre> ...)
>= (repeated <n> #f <sre> ...)
= (repeated <n> <n> <sre> ...)

But I'll let the people who want English names fight
this out.

-- 
Alex