develooper Front page | perl.perl6.language | Postings from October 2005

A listop, a block and a dot

Thread Next
From:
Miroslav Silovic
Date:
October 5, 2005 03:16
Subject:
A listop, a block and a dot
Message ID:
a03a39ec0510041525u2d548a98r7e884ffcca480aa9@mail.gmail.com
Playing with pugs, I ran into this corner case:

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

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

Whitespace after f doesn't change the behaviour (in either case). Is this
behaviour a bug in pugs? Should . bind stronger than non-parenthesised
function call regardless of slurpy?

Miro


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About