develooper Front page | perl.perl5.porters | Postings from August 2001

Re. SUPER:: again, sorry...

Thread Previous | Thread Next
From:
Piers Cawley
Date:
August 13, 2001 07:03
Subject:
Re. SUPER:: again, sorry...
Message ID:
m3g0awkqhk.fsf_-_@iest.bofh.org.uk
merlyn@stonehenge.com (Randal L. Schwartz) writes:

> >>>>> "Piers" == Piers Cawley <pdcawley@iterative-software.com> writes:
> 
> Piers> A few patches to test the SUPER:: pseudoclass. A couple of the tests
> Piers> are marked TODO, it seems that SUPER:: does its dispatch based on the
> Piers> package that it was compiled in, rather than the class it was called
> Piers> in.
> 
> As it exactly should.  You want to look in the method definition's
> superclasses, not the invoked object's superclasses.  See the
> Smalltalk definition, and be enlightened.  No change required.

I finally got 'round to doing this (pp63-64,65-66 Smalltalk 80, the
Language), my emphasis

   An addtional 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 does not begin in the receiver's
   class. Instead the search begins in the superclass of the class
   containing the method.

   [...]
   
   super does not mean start the search in the superclass of the
   receiver, [...]. It means start the search in the super class of
   the class containing the method in which super was used. [...]
   Sometimes, of course, the superclass of the class in which the
   method containing super is found.

which seems (to these eyes at least) to sit rather better with the
dynamic behaviour that I'd like than with the current static
behaviour.

But I have the horrible feeling that the only way I'm going to get
this behaviour is if it's implemented within perl6.

-- 
Piers Cawley
www.iterative-software.com


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About