On Thu, Apr 06, 2006 at 02:35:53PM -0400, Matt Fowles wrote:
: That makes a good deal of sense.  I don't know what I would like more,
: so I guess that I will wait till a more firm consensus is reached.

The current consensus on #perl6 is that, in postfix position only (that
is, with no leading whitespace), m:p/\.+ \s<ws> <before \.>/ lets you embed
arbitrary whitespace, comments, pod, etc, within the postfix operator.

This allows both the short

    :foo. .()

as well as the longer

    $x...
    .foo()

Or possibly m:p/ [ \.+ \s<ws> ]+<before \.>/, which would let you intermix as
many dots into the whitespace as you like:

    $x. . . . . .()

But that's a little out there.  In any event $x..$y is still a range
because there's no whitespace after .. and $x .. $y is still a range
*because* there's whitespace before.  The only casualty is $x... with
trailing whitespace can't mean $x..Inf.  But you almost always want to
put something like a comma or bracket after it anyway.

And the nice thing is that it becomes a drop-dead simple rule that
postfix operators never, ever have leading whitespace, and you can always
distingish an infix operator from a postfix by whitespace.  No more
retroactive guessing games.

It's possible the $x... infinite range operator could be recast to
something else like $x..* or some such, but that's a niggle compared
to the enormity of cleaner parsing.

Larry

Reply via email to