From: Dave Thomas Date: 2003-08-09T06:46:26+09:00 Subject: Re: Ducktype, right? Dan Doel wrote: > So having respond_to? :quack doesn't make it a duck. It's also how quack > is implemented, and there's no way to really check that without > testing. Duck typing means making assumptions. > > Anyhow, that's my take on it all, at the end of the day. I hope I'm not > too off base. If I am, then Dave can yell at me. Great summary! In general, if a Ruby programmer finds themselves using respond_to? too much, I'd ask them 'why?'. If they're switching on the result, then I'd recommend looking at polymorphic solutions, or possibly double dispatch. If they're checking parameters, I'd suggest commenting out the check and seeing what happens. :) Quack! Dave