From: Dan Doel Date: 2004-05-28T06:41:27+09:00 Subject: Re: true.respond_to?("clone") On Thursday 27 May 2004 5:29 pm, Guillaume Marcais wrote: > For example, the classes in socket have plenty of methods which raise an > error on some platforms. I would also preferred them not to be defined > at all. > > If you don't test the existence of the method before calling it, you > will get an exception just as well. So I don't see the point in > unimplemented exception raising methods. > > Guillaume. There's a slight difference between these examples, in that the Socket methods are defined on _some_ platform. I don't think I would expect methods that aren't supported by a particular platform to be undefined, they'd just result in errors when called. Ruby sockets should probably be abstracted above the underlying API and you probably wouldn't want the interface changing based on what operating system the user has. TrueClass#clone, however, is invalid on _every_ platform, so I'd say it's more of a candidate to be undefined. -- Dan