[Grace-core] Another inheritance/initialisation example - invariants

James Noble kjx at ecs.vuw.ac.nz
Sun Aug 5 04:02:21 PDT 2012


> So, cloning an object means that the clone mechanism has to be able to walk the free variable list of the method and block code.
>  ... 
> I deduce that Grace's reflection facilities _must_ provide access to the free variable list of an object — and this is so independent of the semantics we adopt for inheritance.

perhaps - I actually think that is useful, even if only for debugging, but not essential. For example, if Grace supplied a primitive clone operation that could be enough without this reflexive access. After all, custom user code can be written that accesses all these variables

> For me, James' example clarifies what the semantics of Grace inheritance must be.  The issue becomes how to implement it.

OK - but I'm not sure *how* the semantics are clarified (or perhaps that should be which semantics)

Is it that  "blocks (and registrations of self) in super-part-object-construtors should be bound to the resulting whole-object (sub-object-constructor?)

or something else?    On reflection, having to clone invariants is no worse than e.g. having to clone the links inside a list.
But it is easier if you don't have to clone them in the first place!  

James


More information about the Grace-core mailing list