il Thu, 5 Feb 2004 09:31:27 +0900, matz / ruby-lang.org (Yukihiro Matsumoto) ha scritto:: >Hi, > >In message "case with multiple expressions" > on 04/02/05, Hal Fulton <hal9000 / hypermetrics.com> writes: > >|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 I suppose that should be: def ===(otr) self.zip(otr).any? {|i1,i2| i1===i2} end