From: James Edward Gray II Date: 2006-08-14T04:31:24+09:00 Subject: Re: A use case for an ordered hash On Aug 13, 2006, at 5:03 AM, Mauricio Fernandez wrote: > # But this would be nicer > class Array > def cassoc(x) # "case assoc" > each{|arr| return arr if arr[0] === x} > nil > end > end You could use find() there, right? class Array def cassoc(match) find { |arr| arr.first === match } end end James Edward Gray II