From: Trans Date: 2007-09-13T01:39:53+09:00 Subject: Re: before, after and around Ruby 1.9 On Sep 11, 7:39 pm, "Rick DeNatale" wrote: > On 9/11/07, Pit Capitain wrote: > > > The module inclusion chain is already dependent on the sequence in > > which the code is executed, especially if you use super. What I like > > about Matz's proposal is that there is still only one of these chains > > and one way to walk them: super. Having a different way to call the > > next method would make things more complicated, IMO. > > Here's the sequence dependency I'm concerned about. > > class A > def m > puts "Hi from A" > end > end > > class B < A > def m > puts "And now a wird from my superclass.!" > super > end > > class B < A > #fix the typo > def m > puts "And now a word from my superclass!" > end > end > > B.new.m > > With the current semantics, this will produce: > > And now a word from my superclass! > Hi from A > > whereas Matz' proposal would produce: > > And now a wird from my superclass! > And now a word from my superclass! > Hi from A > > How do you REPLACE a method implementation which invokes super in this > brave new world? A possibility: class B redef m puts "And now a word from my superclass!" super end end T.