[Grace-core] super in Grace

Andrew P. Black black at cs.pdx.edu
Sun Feb 6 16:34:11 PST 2011


On 6 Feb 2011, at 15:25, James Noble wrote:

> yep - I don't think anyone is considering changing that

I certainly wasn't suggesting changing that.

> (even Newspeak - I checked :-)
> although Newspeak superclasses are not static   (B would be a virtual class in Newspeak)

Hmm ... if the identity of the superclass in Newspeak is dynamic, then must not the identity of the method that super executes be dynamic too?  

Not that this affects Grace, since I don't think that we are planning on dynamic superclasses.

James writes:

>> 
>> What about multiple occurrences of the same field?  Not a problem, because all fields have unique names, so it can't happen.
> 
> a field is just a getter and a setter method, so it can happen - but one of the fields would be redundant.

The overridden getter and setter methods could still be accessed using the super mechanism.   In fact, this is one reason to allow super-sends of messages with a different name — to more easily allow a method to use an overridden field accessor.

>> What about
>> 
>> 	self.1.myMessage
>> 	self.2.myMessage
>> 
>> to send to the (n-1)st and (n-2)nd method.  Ordinary message send is self.0.message.  And no, you can't omit the self in these special forms.
> 
> but how would you know?

How would I know what?   Maybe I didn't explain my proposal very well.  The numbers are just ordinal numbers that refer to the last, last-1 th, last-2 th occurrence of the method for myMessage in the (statically determined) method list.  This needs a diagram!

	Andrew





More information about the Grace-core mailing list