On 24 Oct 2012, at 21:49, Quentin Mathé wrote:

> I would say that should work if the Trait class and its superclasses, and the 
> targeted class and its superclasses, all use the same exact ivar layout. The 
> important point would be to check every superclass in both class hierarchies 
> (trait and target) to ensure they result in the same ivar layout for an 
> instance.

My original mixins code checked this.  I believe part of the definition of a 
trait is that it is stateless and so should only indirectly access the object's 
state (this is a big part of what differentiates a trait from a mixin) and so 
the traits code should ideally check that the trait class has no ivars at all 
(not even isa, as the trait may be applied to something like GSTinyString of 
GSSmallInt).

David

-- Sent from my brain
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à