From: Piers Cawley Date: 2001-08-08T16:20:32+09:00 Subject: [ruby-talk:19357] Re: Perl/Python/Ruby common backend (Parrot, can Ruby play too?) Ned Konz writes: > On Tuesday 07 August 2001 10:37 pm, Mathieu wrote: > > > Ruby has this thing called "mixins" that afaik is not in Python (unless > > it's quite recent) and is not in Perl. In Perl you have multiple > > inheritance, but the dispatch is C++-style, so calling SUPER looks > > always upwards. Ruby backtracks in the method lookup. (Damian wants that > > in Perl6) > > I don't understand what you mean. In Perl, the method lookup is > first in the current class, and then depth-first through the @ISA > (parent) list. Calling, say, $self->SUPER::method merely skips the > current class (and only works if written in the namespace (package) > of the class that's being defined, not dynamically as I've wanted it > to). Don't get me started on this. See the debate on the subject I had with perl5porters about a month back. And which, having looked up the SmallTalk way of doing it, I may be returning too. Annoyingly, there seems to be no way of implementing a reliable SUPER.pm which will do the right 'dynamic' thing, because perl doesn't cache the appropriate information when it makes the function call. > I could see wanting to do a breadth-first search through @ISA, > or make SUPER work outside of the original namespace. Take a look at Damian's 'NEXT' module. -- Piers Cawley www.iterative-software.com