On Fri, Apr 15, 2005 at 01:25:24AM +0800, Autrijus Tang wrote:
: Okay.  In that case, how about making Perl5ish adverbs work when :P5 is
: specified?  I have just checked in some code to make this work:
: 
:     rx:P5:i:m:s:x:g/.../
: 
: Does it make sense to you?

That means that we either have to have an order dependency or be
very careful not to allow any P6 shortcuts that happen to use the
deprecated Perl 5 modifiers.  Perhaps it would be better to have an
option argument to P5 instead:

    rx:P5('imsxg')/.../

or some such.  Given the current bias towards adverbs slurping up the
following postfix brackets, that could perhaps also be written:

    rx:P5<imsxg>/.../

But that does mean you have to write

    rx:P5 <...>

rather than

    rx:P5<...>

if you want to use brackets for delimiters.  Nevertheless, the rule
seems to simplify things, and with a backtracking token parser it's a
simple mistake to check for and give a decent error message on in most
cases.  I expect people will simply get used to writing all ambiguously
bracketed quote constructs with spaces, as in q:foo:bar (...).  But we
have to allow arguments to adverbs somehow, and restricting them to ()
seems awfully limiting, and I don't really want to have two different
classes of adverbs.  [Extended discussion to p6l please.]

I'd just note that

    rx<...>

is still perfectly acceptable, since there are no adverbs slurping up
an argument.

Larry

Reply via email to