From: MonkeeSage Date: 2006-09-20T18:00:06+09:00 Subject: Re: Ducktator - A Duck Type Validator Robert Klemme wrote: > I do not think that the use of respond_to? is a regular duck typing > technique. As Eric put it, respond_to? is exactly not applied regularly > when duck typing. > > Don't get me wrong, I don't say your lib is useless (in fact I envision > numerous uses for test cases etc.) but I think this claim of yours is wrong. Not to push the issue, but Wikipedia seems to think that this is a valid claim [1]: "[...A]n object having all the methods described in an interface can be made to implement that interface dynamically at runtime, even if the object's class does not include the interface in its implements clause. It also implies that an object is interchangeable with any other object that implements the same interface, regardless of whether the objects have a related inheritance hierarchy." respond_to? in ruby is just a dynamic way of checking that "an object is interchangeable with any other object that implements the same interface". [1] http://en.wikipedia.org/wiki/Duck_typing Regards, Jordan