Luke Palmer wrote:

> Hang on... I thought parens weren't allowed as delimiters.  Or does that 
> not apply to rx()?

Well, yes, we *did* say that in A5 and E5.

But we were thinking of m// and s/// in particular and of patterns with
modifiers (which might take argument lists) in general.

For an C<rx> without modifiers, (...) are certainly unambiguous as delimiters.
So I think they should be allowed. Of course, it's Larry's call and he may
well prefer the simplicity of a blanket prohibition.

If they are prohibited, then my evil rx/rule example no longer works, and
the only difference between C<rule> and C<rx> is that <rx>s can't be named
or parameterized, and C<rule>s can't be imaginatively delimited.

Which then resurrects the original question: is there any reason why
C<sub>s have to be {...}-delimited. The answer to which is: there's no
*technical* reason, but a strong psychological one.

The reason we introduced a switch statement in Perl 6 was because TMTOWTDI
is a mistake if the MTOWs are legion, and all just at the syntactic level.
Computers can deal with all the resulting combinations just fine, but too many
alternatives make it near impossible for humans to comprhend the
resulting code. Those who have seen SelfGOL will know what I mean.

There's a clear advantage to allowing patterns to be arbitrarily delimited
(because it allows us to avoid excessive escaping when the standard delimiter
characters appear in the pattern). But there's no equivalent "win" in allowing
subroutines to be arbitrarily delimited.

So I very much doubt we'll see it.

Damian

Reply via email to