On Monday 07 June 2004 09:02, Richard Kilmer wrote:
>
> Right...I was thinking...you could add this to Ruby:
>
> class Foo
>
>   def [](key)
>     @mymap[key]
>   end
>
>   def []=(key, value)
>     @mymap[key] = value
>   end
>
>   equivalent_method(:[], :[]=, Hash)
>
> end
>
> Then...
>
>
> f = Foo.new
> f.respond_to?(:[], Hash) => true
> F.respond_to?(:[], Array) => false

This is interesting, although I would like if there were a way to quickly test 
for an entire suite of methods belonging to an interface.  This way of doing 
things still boils it down to checking one method at a time.  It would 
probably suffice, but I'd like something more complete.

	Sean O'Dell