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

Frank Shearar frank.shearar at gmail.com
Wed Jun 19 18:02:58 UTC 2013


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.

frank

> 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