[Grace-core] [low importance] "as" clauses & super requests
Andrew P. Black
black at cs.pdx.edu
Sat Mar 9 18:21:20 PST 2013
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/e1f7f1af/attachment.html>
More information about the Grace-core
mailing list