Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Should this be valid in perl 6?

26 views
Skip to first unread message

Yiyi Hu

unread,
Aug 16, 2005, 3:03:39 AM8/16/05
to perl6-c...@perl.org
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

Autrijus Tang

unread,
Aug 16, 2005, 12:42:31 PM8/16/05
to Yiyi Hu, perl6-c...@perl.org
On Tue, Aug 16, 2005 at 03:03:39PM +0800, Yiyi Hu wrote:
> $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;"

Hm, I think that's a case of a unimplemented special case.

I have just sent you a committer invitation; please write it up as a
test in t/syntax/ and commit the new test.

Thanks!
/Autrijus/

Autrijus Tang

unread,
Aug 16, 2005, 1:31:56 PM8/16/05
to Autrijus Tang, Yiyi Hu, perl6-c...@perl.org
On Wed, Aug 17, 2005 at 12:42:31AM +0800, Autrijus Tang wrote:
> > class TMP { method tmp { "Hello".say}; }; my TMP $t .= new;
> > tmp $t;
> >
> > So, I wonder, If perl 6 will allow "tmp $t;"
>
> Hm, I think that's a case of a unimplemented special case.
>
> I have just sent you a committer invitation; please write it up as a
> test in t/syntax/ and commit the new test.

Fixed as r6286. Please still commit the test, and add your
(ideographic?) name to AUTHORS.

Thanks,
/Autrijus/

0 new messages