[Grace-core] Inheritance and object initialisation

James Noble kjx at ecs.vuw.ac.nz
Thu Jul 19 02:24:50 PDT 2012


On 17/07/2012, at 08:52 AM, Kim Bruce wrote:

> One semi-independent decision is the interpretation of "self" in blocks/closures.  I propose that both "self" and "return" should be evaluated as they would be in the containing environment, rather than in the object encoding the block/closure.  Thus in
> 
> class C.new {
>     def x = 1
>     def y = {self.x}
> }

I think this has to be the case, and is standard for Smalltalk/Self/Newspeak, where we cribbed this from 

J


More information about the Grace-core mailing list