On Thu, Aug 11, 2005 at 08:02:00PM +1000, Stuart Cook wrote:
> 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?

My current reading is a) -- but only if ::x stays implicitly
"is constant".  So your "assigned" above should read "bound".

> Also, can I do crazy stuff like this?
>     my $a = ::Foo;
>     my ::$a $obj;  # analogous to @$x, where $x is an arrayref

Note that $a at compile time is unbound, so that automatically fails.
Now had you written this:

    my $a ::= ::Foo;
    my ::$a $obj;

Then I can see it working.


Attachment: pgp1SkCTrbh4L.pgp
Description: PGP signature

Reply via email to