super super

Torge Husfeldt jean-jaques.gelee at gmx.de
Thu Feb 17 10:20:30 UTC 2000


Super Hi,
I don't think that is a good Idea to implement super super.
It makes Code harder to understand. If ever you feel the need
of using super super be sure you found a (minor) design-flaw in
the Code you're just visiting. Feel free to refactor it and 
(if it concerns some classes in the base image) post your version
to this list. There is always a solution using a new selector
like basic<Selector>.
BTW: I think it should be strongly discouraged to use super with
a selector different from the one you're implementing. If you do this 
what you really want to express is the :: operator of C++.
BUT: super is only meant to express that the new method extends the one
defined in the superclass.
IMHO super-calls are appropriate only in three positions:
at the beginning of the method, at the end of it, in one branch of an
ifTreu:ifFalse: statement at the top level of the method.
>   Hi,
> 
>   It seems that it's time to write the future language
> extension, so I write my random thought:-)
> 
>   When I was writing #addCustomMenuItems:hand: for a morph,
> I wish I could write something like
> 
>    super super addCustomMenuItems: aCustomMenu hand: aHandMorph.
> 
> at the top of of the method.  The intention was to bypass
> the superclass' #addCustomMenuItems but want to call the
> supersuperclass' one before adding my own menu items.  
> 
>   It might be seen as the double-colon operator in C++, or
> something like that.
> 
>   Certainly it adds some complexity of the intepretation of
> "super" and there might be such attempts before (in
> 60's?):-) but I want to hear the opinion of someone else.
> 
>   -- Yoshiki
> 

-- 
Sent through Global Message Exchange - http://www.gmx.net





More information about the Squeak-dev mailing list