[Survey] About the cognitive surcharge of super

Stephen Pair squeak-dev at lists.squeakfoundation.org
Fri Sep 6 17:46:09 UTC 2002


It would be nice to have a generalized syntax for generating message
send bytecodes that have alternate message sending semantics.  I have
the same issue when wanting to generate delegation bytecodes...what
syntax should I use?

The keyword super really means "send a message to self, but begin the
method lookup at the superclass of the class where the current method is
defined."  So, you are still sending the message to self, you're just
using a different algorithm for the method lookup.

There are other cases where you might need such a generalized syntax
(i.e. if you were using selector spaces and needed a keyword message to
resolved to some other selector than the global Symbol).
 =20
- Stephen

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org=20
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On=20
> Behalf Of Stephane Ducasse
> Sent: Friday, September 06, 2002 11:59 AM
> To: squeak dev
> Subject: [Survey] About the cognitive surcharge of super
>=20
>=20
> Hi
>=20
> I tried the following test on a lot of people and I was surprised to=20
> see that so much people got confused.
>=20
> I defined the following method on a class
>=20
> MyClass>>test1
> 	^ super =3D=3D self
>=20
> MyClass>>test2
> 	^ self class =3D=3D super class
>=20
>=20
> then asked MyClass new test1 and MyClass new test2.
>=20
> I would like you to try and think as much as you can about=20
> the answer. Then replied to this email with the results you=20
> thought. If you do the tests around you please report to me=20
> the result you got.
>=20
>=20
>=20
>=20
> Do the test before reading further...
>=20
> I found that lot of people were confused by the second test.=20
> I have the=20
> impression that super is cognitively overloaded and should have be be=20
> called overriden or callNextMethod as in clos.
> For now I got only three good answers including mine :).
>=20
>=20
> 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
>=20
>=20
>=20




More information about the Squeak-dev mailing list