From: Hal Fulton Date: 2004-05-28T07:28:10+09:00 Subject: Re: true.respond_to?("clone") Michael Campbell wrote: > On Fri, 28 May 2004 07:15:59 +0900, Sean O'Dell wrote: > >>Why have respond_to? at all then? Why not just catch NotImplementedError >>everywhere you need to check an object before trying to call a method? > > Convenience? > > It really can only do what it's doing though, no? Trying to determine > anything beyond "does there exist an implementation, however crappy or > useless it may be" sounds a lot like trying to solve the halting > problem. It's not really a question of how respond_to? should behave or how much work it should do. The question is: Do we gain anything by defining TrueClass#clone rather than just leaving it nonexistent? The only rationale I can think of is that "later" there might be a TrueClass#clone implemented, and we're leaving a placeholder for it... but this seems unlikely to me and a flimsy justification. Hal