[Grace-core] Super-Outer-Objects: What does your language (gBeta/Newspeak/Scala/Java…) do with this? What should Grace do?

James Noble kjx at ecs.vuw.ac.nz
Wed Nov 21 19:51:05 PST 2012


On 22/11/2012, at 14:56 PM, Andrew P. Black wrote:

> I'm pretty sure that A.pathological is a syntax error: undeclared variable A.  A is not in scope on the rhs of def A = …

You're right - I thought it was in scope but it's not. So this doesn't work either - should it? 

def A is public, readable = object {
       method pathological {print "A-pathological"}  
       def B = object {
            method foo {pathological}
            method bar {A.pathological}
        }
}

> Maybe it should be allowed, but right now, it's not.  Going form memory, I don't believe that the spec says anything about this.

Probably because it's been languishing without updates for far too long.

This works though - should it?

method A {return object {
       method pathological {print "A-pathological"}  
       def B = object {
            method foo {pathological}
            method bar {A.pathological}
        }
}}

I don't understand the difference here, under either interpretation of the rules about defs, but perhaps I'm missing something

J


More information about the Grace-core mailing list