From: nobu.nokada@... Date: 2004-02-05T10:00:26+09:00 Subject: Re: case with multiple expressions Hi, At Thu, 5 Feb 2004 09:31:27 +0900, Yukihiro Matsumoto wrote in [ruby-talk:91585]: > |Is there anything wrong with this kind of solution? > | > | case [x,y,z] > | when [1,2,3] then #... > | when [1,2,4] then #... > | when [2,2,3] then #... > | else ... > | end > > Hmm, if we define Array#=== as > > def ===(other) > self.all?{|item| item === other} > end Shouldn't it be: index = -1 other.each_with_index do |item, index| unless self.fetch(index) {return false} === item return false end end return self.size == index + 1 -- Nobu Nakada