|
Subject: Typed type variables (my Foo ::x) Newsgroups: gmane.comp.lang.perl.perl6.language Date: 2005-08-11 10:02:00 GMT (3 years, 46 weeks, 6 days, 18 hours and 11 minutes ago)
Hi,
What's the current meaning of type annotations on type-variables?
For example, if I say...
my Foo ::x;
...which of these does it mean?
a) ::x (<=) ::Foo (i.e. any type assigned to x must be covariant wrt. Foo)
b) ::x is an object of type Foo, where Foo.does(Class)
c) Something else?
I seem to recall Damian suggesting (a) in order to solve the "what's
the invocant type of a class method" problem[1], but I wasn't sure
whether it was already canon.
Also, can I do crazy stuff like this?
my $a = ::Foo;
my ::$a $obj; # analogous to @$x, where $x is an arrayref
Thanks,
Stuart
[1] <http://www.nntp.perl.org/group/perl.perl6.language/21914>
|
|
|