From: Matt Armstrong Date: 2002-02-14T08:22:16+09:00 Subject: Re: qualms about respond_to? idiom David Alan Black writes: > Hi -- > > On Thu, 14 Feb 2002, Dave Thomas wrote: > >> module StartTag; end >> >> Then we have >> >> do_somthing if e.kind_of? StartTag >> >> Does that communicate the intent? > > Isn't it a return to branching on type, though? Using respond_to? is a form of branching on type in any case. Dave is using a module to communicate that a particular class conforms to a particular interface -- which allows the use of kind_of? to test for the interface. -- matt