develooper Front page | perl.perl6.compiler | Postings from August 2005

Should this be valid in perl 6?

Thread Next
From:
Yiyi Hu
Date:
August 16, 2005 09:27
Subject:
Should this be valid in perl 6?
Message ID:
f469f8de0508160003765dcc47@mail.gmail.com
Indirect object notation now requires a colon after the invocant if
there are any arguments. If there are no arguments and you omit the
colon, the notation is parsed either as a named unary operator or a
list operator with one argument. In any case, all of these come out to
the same thing:

    $handle.close
    close($handle)
    close $handle:
    close $handle

From Synoposis, It's said that the last example( close $handle )
should be valid.
But in pugs, It isn't.

class TMP { method tmp { "Hello".say}; }; my TMP $t .= new;
tmp $t;

So, I wonder, If perl 6 will allow "tmp $t;"

Thanks,
Xinming

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