Re: S5: range quantifier woes

2004-09-18 Thread Jonathan Scott Duff
On Sat, Sep 18, 2004 at 03:00:09PM -0400, Kurt Hutchinson wrote: > Repitition is a kind of assertion, after all, and it seems like it > should get to play in the same angle-bracket sandbox as the other > assertions. Once I got to thinking about **{}, the less and less it looked like an assertion t

Re: S5: range quantifier woes

2004-09-18 Thread Luke Palmer
Kurt Hutchinson writes: > For specifying in-rule repetitions, why not use the rule modifer we > already have for specifying whole-rule repetitions; namely, C<:x>. Allow > :x inside rules like :i and :w, and we get something like this: > rx :w/ three m's\: [:3xm] / > rx :w/ t

Re: S5: range quantifier woes

2004-09-18 Thread Luke Palmer
Dan Hursh writes: > Second, if it is a problem that '?' is too far away, how about this? > > [foo]**{5..3} # greedy > [foo]**{3..5} # lazy Because 5..3 is the empty list. This wasn't a mistake in Perl 5, so it's staying in Perl 6. > Oh, is there a way to trick this closure syntax into being

Re: S5: range quantifier woes

2004-09-18 Thread Kurt Hutchinson
Please forgive me if these ideas have been discussed before. I don't remember having read them elsewhere. For specifying in-rule repetitions, why not use the rule modifer we already have for specifying whole-rule repetitions; namely, C<:x>. Allow :x inside rules like :i and :w, and we get somethin

Re: S5: range quantifier woes

2004-09-18 Thread Dan Hursh
Jonathan Scott Duff wrote: - for minimal matching the ? is too far away from the operator that it applies to. It looks like it's doing something to the closure (and maybe it is) Should that be [foo]**?{$m..$n} instead? - Bringing a closure into the picture seems to put too much power in such

Re: S5: range quantifier woes

2004-09-17 Thread Larry Wall
On Fri, Sep 17, 2004 at 05:15:58PM +0200, Juerd wrote: : Jonathan Scott Duff skribis 2004-09-17 9:57 (-0500): : > [foo]~5 # match exactly 5 times : > [foo]~{0...}# verbose [foo]* : > [foo]~{1...}# verbose [foo]+ : > [foo]~{1..5}#

Re: S5: range quantifier woes

2004-09-17 Thread Larry Wall
On Fri, Sep 17, 2004 at 09:57:14AM -0500, Jonathan Scott Duff wrote: : Now for the bothersome parts and some questions and some suggestions in : no particular order: : : - for minimal matching the ? is too far away from the operator that it : applies to. It looks like it's doing something to the

Re: S5: range quantifier woes

2004-09-17 Thread Juerd
Jonathan Scott Duff skribis 2004-09-17 9:57 (-0500): > [foo]~5 # match exactly 5 times > [foo]~{0...}# verbose [foo]* > [foo]~{1...}# verbose [foo]+ > [foo]~{1..5}# match from 1 to 5 times > [foo]~{[1,3,5]} #

S5: range quantifier woes

2004-09-17 Thread Jonathan Scott Duff
The new range quantifier syntax has been bothering me. For reference, here's the bit of S5 that talks about it: > The repetition specifier is now **{...} for maximal matching, with a > corresponding or **{...}? for minimal matching. Space is allowed on > either side of the asterisks. The curlies