Slots and methods.

nicolas.pelletier3 at free.fr nicolas.pelletier3 at free.fr
Sun Oct 24 11:38:55 PDT 2004


Pupeno <pupeno at pupeno.com> writes:

> Then I could do:
> myCircle area.
> to get the area of my circle.
> But since that founction can take Circle traits, I could also do 
> myCircle traits area.
> Which leads to the error:
> The method #radius was not found for the following arguments:
> {("Circle" parent0: ("Cloneable" ...). printName: 'Circle'. traits: 
> ("Traits" ...))}

The #area  method tries to  find a slot  named #radius on  the current
object,  and fails  (rightfully) when  that current  object  is Circle
traits, since the #radius slot is  stored on Circle (and not on Circle
traits). So everything works fine.

-- 
Nicolas




More information about the Slate mailing list