On Thu, Sep 21, 2006 at 12:16:26PM -0400, Mark J. Reed wrote:
: Which means that argumentless subroutine calls will presumably be rare
: in P6 code, but what about methods?  Methods with no arguments (apart
: from the invocant) will always be commonplace, and it seems to me that
: you have exactly the same ambiguity there:
: 
: $o.a%$b
: $o.a % $b
: $o.a %$b

A method never takes arguments unless you use : or (), so those are
all infix.  The design team worked Really Hard to get rid of that
particular ambiguity in Perl 6.  Argumentless methods parse more
like variables than like functions.

Incidentally, this is why all the optional arg functions that default
to $_ turned into methods, so you have use .print if you want to print
$_ by default.  Unlike a bare "print", a ".print" doesn't expect more
arguments unless you put : or (), so it simplifies parsing greatly.

Larry

Reply via email to