From: "David A. Black" Date: 2007-12-07T05:22:55+09:00 Subject: Re: Worth an RCR? static_type_check, polymorphic_type_check, Hi -- On Fri, 7 Dec 2007, Stefan Rusterholz wrote: > Robert Klemme wrote: >> 2. point in time is not the only difference as you have pointed out >> (method_missing). > > While I mostly agree with what you say: if somebody defines > method_missing, he should update respond_to? accordingly. Anything else > I'd consider a bug. You might want to file a bug report against the standard library: >> require 'ostruct' => true >> os = OpenStruct.new => # >> os.respond_to?(:"a=") => false >> os.a = 1 => 1 :-) I think it all depends on exactly what you're doing with method_missing. In general, I tend to see it the other way around: respond_to? tells you what the object's current knowledge of its messages is, while method_missing is specifically a handler for messages the object does *not* respond to. In the end, it can be done either way, and probably should be, in different situations. I wouldn't say that either approach is inherently buggy. David -- Upcoming training by David A. Black/Ruby Power and Light, LLC: * Intro to Rails, London, UK, December 3-6 (by Skills Matter) See http://www.rubypal.com for details and 2008 announcements!