[Grace-core] nesting - what should "self" be when invoking lexically scoped methods

James Noble kjx at ecs.vuw.ac.nz
Wed Aug 8 15:55:50 PDT 2012


This code prints "o" twice.   Is that what it should do?

In particular, shouldn't the call "runi" print "i"

James


def o = object {
    method foobles { print "o" }
    method m { foobles }
    method runo { m }
    
    def i = object {
        method foobles { print "i" }
        method runi { m }
    }
    
    
}

o.runo
o.i.runi 


More information about the Grace-core mailing list