Larry Wall wrote:

Another problem we've run into is naming if there are multiple assertions
of the same name.  If the capture name is just the alpha part of the
assertion, then we could allow an optional number, and still recognize
it as a "ws":

   <ws1> <ws2> <ws3>

Except I can well imagine people wanting numbered rules.  Drat.  Could
force people to say <ws_1> if they want that, I suppose.

Or we could use some standard delim for that:

   <ws-1> <ws-2> <ws-3>

which is vaguely reminiscent of our "version" syntax.  Indeed, if we
had quantifications, you might well want to have wildcards <ws-*> and
let the name be filled in rather than autogenerating a list.  But maybe
we just stick with lists in that case.

For captures of non-alpha assertions, we could say that ? is the same
as "true" (just as with regular operators), and so

   <true-3 +<alpha>-[aeiou]>

would capture to $<true-3>.  (And one could always do an explicit binding
for a different name.)

Actually, I think people would find $<match-3> more meaningful than
C<true-3>.


PHP's use of $array[] as "push" might work for this:

<true[] +<alpha>-[aeiou]>

or

<@true +<alpha>-[aeiou]>

or

<true=<1..> +<alpha>-[aeiou]>

or

<true@ +<alpha>-[aeiou]>

I like the idea of being able to "continue" versus "chunk" patterns. How do you say "This is a continuation of the other <thing>" versus "This is a separate <thing>" ?

=Austin



Reply via email to