[Survey] About the cognitive surcharge of super

Stephane Ducasse squeak-dev at lists.squeakfoundation.org
Fri Sep 6 18:40:45 UTC 2002


On vendredi, septembre 6, 2002, at 08:20  PM, Andreas Raab wrote:

> Stephane,
>
>> MyClass>>test1
>> 	^ super =3D=3D self
>>
>> MyClass>>test2
>> 	^ self class =3D=3D super class
>>
>>
>> then asked MyClass new test1 and MyClass new test2.
>
> It must be true and true but it took me a while to get down to *why*
> this is. BTW, the test is not very good here since actually #class is =
a
> special selector (represented as bytecode) which is never looked up.=20=

> But
> the principle is right.

But here this is supervicious :) and in VW we can (at leats in 30 we=20
could I did not
check in 70) redefine class for doing fun thing like having metaobject=20=

as instance of behavior
as in CodA.



>
>> Do the test before reading further...
>>
>> I found that lot of people were confused by the second test.
>
> Probably so. Part of it is that it's easy to confuse "super class" =
with
> "superclass" which have wildly different meanings.
>
> The other issue is that because of the minimal syntax employed in
> Smalltalk it's easy to think about "super" as a variable with the
> meaning of "the receiver cast to its superclass" (to borrow a horrible
> meaning from some well-known other languages ;-) It would probably be
> more explicit to use #perform:inSuperclass: instead.
>
> Cheers,
>   - Andreas
>
>
>
Dr. St=E9phane DUCASSE (ducasse at iam.unibe.ch)=20
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you do
  different? ... especially if, by doing something different, today
  might not be your last day on earth" Calvin&Hobbes





More information about the Squeak-dev mailing list