Miko O'Sullivan writes:
: From: "Larry Wall" <[EMAIL PROTECTED]>
: > It's unlikely that {n,m} will still have that meaning in Perl 6.  Maybe
: we'll
: > have something like this:
: >
: >     Perl 5 Perl 6
: >     {1,3} <1..3>
: >     {3} <3>
: >     {3,} <3+>
: >     {0,3} <3->
: 
: What are your feelings on multiple ranges for matches?  E.g. the following
: expression means "1 to 3, 5, or 10 or more":
: 
:     <1..3|5|10+>

My feelings are that nobody has ever asked me for it before, so it's
not something worth making special syntax for.  On the other hand, if
instead of inventing new syntax we stick to a more Perlish syntax, we
could generalize it to an ordinary slice kind of list:

     <1..3,5,10..Inf>

But you'd still have the complexity of making it work, and it still
seems like something almost nobody would ever use.  And you could get
the same effect with an appropriate assertion:

    (...)* { @$+.length =~ (1..3,5,10..Inf) or fail }

That's assuming that quantified captures produce arrays rather than
the final match as Perl 5 does.

Larry

Reply via email to