On Wed, 21 Apr 2004, Brent 'Dax' Royal-Gordon wrote:
> Which actually brings up an interesting question:
>
>      class Silly {
>          has $.thing=1;
>          has @.thing=(2, 3);
>          has %.thing=(4 => 5, 6 => 7);
>      }

I had assumed that'd be illegal: each of $.thing, @.thing and %.thing
autogenerates a method named thing. I would hope that is illegal, for my
head would hurt otherwise keeping track of what a particular "thing"
means.

We surely don't allow the following in the same class:
        has @.thing is Array of Cat;
        has @.thing is Array of Dog;

It seems to me that the $.thing/@.thing issue is similar (though the
sigil makes this easier for the compiler):
        has $.thing is Scalar;
        has @.thing is Array;

--Abhijit

Reply via email to