From: Yusuke ENDOH Date: 2009-09-01T01:25:35+09:00 Subject: [ruby-core:25223] Re: Module#prepend and Array#prepend 2009/9/1 Yusuke ENDOH : > 2009/8/31 Rick DeNatale : >> On Mon, Aug 31, 2009 at 8:39 AM, Yusuke ENDOH wrote: >>> I cannot guess the problem you want to solve. �I know this mail >>> is just discussion log or reminder, but I'd like you to elaborate >>> your proposal completely when sending to ruby-core. >> >> Perhaps I'm mistaken but I think that besides the 'syntax' difference, >> Yehuda's intent was that something like this would work: >> >> >> class Person >> � �def speak(str) >> � � � � str >> � �end >> end >> >> p = Person.new >> >> p.speak("hello") #=> "hello" >> >> module LoudSpeaker >> � def speak(str) >> � � � � super(str.upcase) >> � end >> � end >> end >> >> class Person >> � �prepend Voice >> end >> >> p.speak("hello") #=> "HELLO" > > > Even if it is Yehuda's intent, I cannot see yet when it is necessary. > > Indeed, we can define and refine classes dynamically, but I don't think > that the feature's abuse is recommended. �I think we should consider > more actual circumstances than Person#speak to determine whether it is > surely needed. Sorry I forgot to say thank you for giving your reasoning. Thank you. -- Yusuke ENDOH