From: "Florian Groß" Date: 2005-04-27T01:36:45+09:00 Subject: Re: Announcing Reg 0.4.0 David A. Black wrote: > extending the system so that it could match, for example, > "an array of objects that respond to '[]'" (or something along those > lines)? I wonder if he could just support objects that implement === which would give you Range and Module support and ruby-contract support for free. But how is this related to your quote at all? ruby-contract offers a Check::Quack[:message] adaptor that implements === via respond_to?() -- I wonder if it would be a good idea to define Symbol#=== which would be used like this: first = case obj when :first then obj.first when :fetch then obj.fetch(0) when :at then obj.at(0) when :[] then obj[0] end Or in combination with ruby-contract's signature(): class IO def pretty_output(*objs) objs.each do |obj| puts obj.pretty end end signature :pretty_output, :repeated => :pretty, :block => false end