[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
Tue Nov 20 13:51:37 PST 2012


> Somehow I never realized that aspect of Self.

Self *doesn't* have object nesting: it does have multiple inheritance,
and you can set up objects as if you had object nesting...

> To put the punch line at the beginning, I believe questions about
> identifier lookup can be answered by considering the requirement of
> having at least optional static typing for Grace.

yes, that's a very good point...

> The dynamic lookup doesn't need to have the
> same result as the static lookup, but it needs to resolve to something
> compatible to the static lookup.

right - so in fact you might be able to get away with an object overriding
a super-outer-object's method, but the types would have to be compatible.

> Let me now give the rules that Scala and Java use, and then show how
> that plays out in the devious example code that you posted, James.

thanks - I think this is consistent with the current interpretation in Grace...

> In Scala and Java, if the result of a scope lookup is an object
> member, then a "this" expression is automatically inserted, thus
> turning it into a selection.

Yes, and I think we can use a minor variation on that rule for Grace as well.

James


More information about the Grace-core mailing list