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

David T. Lewis lewis at mail.msen.com
Wed Jun 19 17:55:19 UTC 2013


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.

Dave

> 
> frank
> 
> On 19 June 2013 17:55, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
> > As long as you don't write things like  (self send: #someMessage to: super),
> > there's not much possible confusion ;)
> >
> > Nicolas
> >
> >
> > 2013/6/19 Vaidotas Did??balis <vaidasd at gmail.com>
> >>
> >> > But, to my horror, "a := super" is valid syntax!
> >>
> >> from Wikipedia (https://en.wikipedia.org/wiki/Smalltalk): "...  true,
> >> false, nil, self, super, and thisContext. These are actually called
> >> pseudo-variables, identifiers that follow the rules for variable
> >> identifiers but denote bindings that the programmer cannot change.".
> >> My understanding that a := super is valid.
> >>
> >
> >
> >
> >


More information about the Squeak-dev mailing list