[Grace-core] [low importance] "as" clauses & super requests
Kim Bruce
kim at cs.pomona.edu
Sat Mar 9 18:35:30 PST 2013
The semantics of super is different than a regular message send because it is static ally bound. I'm a little nervous about introducing too many syntactic variations (even with different semantics), but super::m might work.
Just to make you all feel better, my plane has been delayed again. With a little luck we'll get off before 9 pm - still arriving earlier than if I had taken my original (delayed) flight.
Sent from my iPad
On Mar 9, 2013, at 7:21 PM, "Andrew P. Black" <black at cs.pdx.edu> wrote:
> I'm on the 'plane, but amazingly, still getting the United Club network!
>
> On 9 Mar 2013, at 11:15 , James Noble wrote:
>>
>> Basically:
>>
>> ** inherit x as y
>>
>> gives a name to the "part object".
>>
>> This is mostly useful for multiple inheritance, it would allow directed resends to a particular parent.
>> These names are syntactically valid only where "super" is now valid: only to the left of the dot.
>>
>> ...
>>
>> We should at least consider whether we should find some other syntax for super.X (or y.x where
>> y is a local parent name). C++'s super::X is one possibility. Or not: Self and OCAML both use
>> y.x for this...
>
> super.x and y.x are both misleading, because there is no part object. The receiver is self.
>
> Logically, it would make more sense to say
>
> self.y::x
>
> where y::x is a local name for y's method. It more clearly says that the receiver is super, and the method is y's x method.
>
> Of course, self is optional, so this could be abbreviated to y::x. But that's much less misleading, I think, than y.x.
>
> Even without the "as" renaming, we could write super::x. I really do prefer this to super.x, which has always been confusing.
>
> Andrew
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailhost.cecs.pdx.edu/mailman/private/grace-core/attachments/20130309/8afbfe78/attachment.html>
More information about the Grace-core
mailing list