From: "David A. Black" Date: 2008-10-03T20:58:44+09:00 Subject: Re: No warning for redefine Hi -- On Fri, 3 Oct 2008, Han Holl wrote: > Hi, > > Shouldn't the following: > > #!/usr/bin/ruby -w > > module Mixin > def function > puts 'Mixin' > end > end > include Mixin > def function > puts 'Main' > end > > function > # end of demo.rb > > produce something like: > > demo.rb:9: warning: method redefined; discarding old function > > Behaviour now is to discard the mixed-in method silently. It's not discarded; it's still there (in the module) and you can use it with other classes, or reach it through 'super' in the override. Discarding means you can never get to a method again: class C def m end def m # Previous m is now completely uncallable end end David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!