[squeak-dev] [bug] 0007770: cascading does ont work with super

David T. Lewis lewis at mail.msen.com
Wed Jun 19 18:45:06 UTC 2013


On Wed, Jun 19, 2013 at 07:02:58PM +0100, Frank Shearar wrote:
> On 19 June 2013 18:55, David T. Lewis <lewis at mail.msen.com> wrote:
> > On Wed, Jun 19, 2013 at 06:27:27PM +0100, Frank Shearar wrote:
> >> Well, I really really don't _ever_ want to see something like this:
> >>
> >>     foo bar baz: super
> >>
> >> But that's just me, maybe. Maybe I should imagine super as being a
> >> transparent proxy for self, with custom lookup.
> >
> >
> > Yes. From the blue book:
> >
> > "An additional pseudo-variable named super is available for use in a
> > method's expressions. The pseudo-variable super refers to the receiver
> > of the message, just as self does. However, when a message is sent to
> > super, the search for a method does not begin in the receiver's class.
> > Instead, the search begins in the superclass of the class containing
> > the method."
> >
> > So super is supposed to refer to the same object as self.
> 
> Yes. But does that mean this this:
> 
>     super foo;
>        bar
> 
> is sensible and so should compile? Because the Compiler's quite clear
> that you may not cascade on super. It's the _only_ thing on which you
> can't cascade, in fact.
> 

It does not mean that it is sensible, nor does it say anything about
whether or not it should compile.

It seems to me that it is sensible to say exactly what you mean,
either this:

  super foo.
  super bar.

or this:

  super foo.
  self bar.

Dave



More information about the Squeak-dev mailing list