HaloO,
Larry Wall wrote:
Sure, that one might be obvious, but quick, tell me what these mean:
say .bar
say .()
say .1
when .bar
when .()
when .1
foo .bar
foo .()
foo .1
.foo .bar
.foo .()
.foo .1
I'd rather have a rule you don't have to think about so hard. To me
that implies something simple that let's you put whitespace *into*
a postfix without violating the "postfixes don't take preceding
whitespace" rule.
To me your examples fall into three categories that are distinguished
by the type of characters following the dot
.bar # identifier --> postfix method
.() # parens --> postfix invocation
.1 # number literal
From there on the difficulty comes not from the syntax but the
intended semantics! E.g. the non-whitespace when(), when.() and
when.bar are syntax errors, right? So why should the whitespace
version suddenly mean invocation or dispatch on topic?
The only thing that bothers me is that more parens and explicit
$_ will be needed. E.g. say (.bar) or say $_.bar in the first triple.
And the compiler has to know something about the bare foo. Apart
from that the syntactic rules are simple.
--