[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Re: possible bug in method dictionary

From: Joel VanderWerf <vjoel@...>
Date: 2004-11-12 20:41:35 UTC
List: ruby-core #3721
Ryan Davis wrote:
> 
> On Nov 12, 2004, at 3:23 AM, nobu.nokada@softhome.net wrote:
> 
>> It silently redefines and discards old one.
> 
> 
> OK. I think I have a more clarified issue now. Thank you very much Nobu 
> for forcing me to look at this w/o inline. The key difference between 
> what your version does and what inline does is in classes vs modules. 
> Inline defines modules and then mixes them in with include. Maybe Inline 
> shouldn't do that anymore, I dunno. It turns out that C extensions 
> aren't even necessary to show what I am talking about. For example:
> 
> class MyTest
>   def test_method
>     puts "running stupid version"
>   end
> end
> 
> module MakeBetter
>   def test_method
>     puts "running better version"
>   end
> end
> 
> t = MyTest.new
> t.test_method
> 
> class MyTest
>   include MakeBetter
> end
> 
> t.test_method
> 
> # just in case it is some static thing per instance:
> t = MyTest.new
> t.test_method
> 
> ----
> 
> Again... I'm not sure if this is a bug. It really depends on the 
> language definition.
> 

Isn't this behavior an expected consequence of the method search order 
trhough the ancestors of the class?

p MyTest.ancestors # ==> [MyTest, MakeBetter, Object, Kernel]

MyTest comes before MakeBetter, because MakeBetter is a module included 
in MyTest.

In This Thread