[Grace-core] Inheritance and object initialisation

James Noble kjx at ecs.vuw.ac.nz
Wed Jul 25 17:56:53 PDT 2012


On 26 Jul 2012, at 07:32, "Andrew P. Black" <black at cs.pdx.edu> wrote:

> I just realized that, if one wants the Smalltalk-like (and Java-like) behavior of every object running an "initialize" method _after_ it is created, then we can get that behaviour in a similar way to the way that Smalltalk gets it — by inheritance

So this does two things: 
 - classes (or at least inheritingClasses) now inherit, and this inheritance has to match "instance" inheritance 
  - it will initialize each part-object separately - if you inherit from one of these classes it will already be initialized. 

Assuming the code in each object-constructor-literal runs in the object being created, I'm not sure how this helps rather than just putting the code inside the bottom of the literal
J


More information about the Grace-core mailing list