Luke Palmer wrote:
On 10/4/05, Miroslav Silovic <[EMAIL PROTECTED]> wrote:

Playing with pugs, I ran into this corner case:

sub f($x) { say $x; }
f {1}.(); # ok, outputs 1

IIRC, this puts f into the named unary precedence level
which is below method postfix. Thus we get

  (f ({1}.()))

sub f([EMAIL PROTECTED]) { say @_; }
f {1}.(); # outputs block, tries to call a method from the return of say,

Which is because now f is on the listop precedence above method postfix
and the parens are

  ((f {1}).())

Whitespace after f doesn't change the behaviour (in either case).

You mean in the defining special form? There I think is no
difference between 'sub f(' and 'sub f ('.

Is this
behaviour a bug in pugs? Should . bind stronger than non-parenthesised
function call regardless of slurpy?

I think that's what it should do, yes.

So you mean to lower listop in precedence below method postfix?
BTW, has listop always been top precedence? And where exactly should
it go? Actually there is a precedence level called 'list op (rightward)'
which in my eyes naturally is below comma which in turn is below the
assignment ops.
$TSa.greeting := "HaloO"; # mind the echo!

Reply via email to