From: "Aleksi Niemelä" Date: 2000-07-04T19:39:08+02:00 Subject: [ruby-talk:03806] Re: Immature idea for case-when > Well, you can do something (almost) equivalent in standard Ruby--you > can associate closures with the 'when' conditions: ... > when check {|n| n & 1 == 0} > puts "#{number} is even" ... Quite neat hack, thanks Dave! This probably solves few problems, but I could argue that my original case remains intact (or one have to duplicate some code). There are two ways one can think things to happen: case arg when obj # leading to obj.===(arg) or case obj when arg # leading to arg.===(obj), while we would like obj.===(arg) Even more, we might want to have Obj.=== for common use and be able to say "listen case, this time when comparing which 'when' might be the correct one, do not use === please. Could you kindly check with foo?" case obj:method # look, I just invented notation :) when arg # leading to obj.method(arg) This has one notable feature: case obj:=== when arg works exactly same as current version :). - Aleksi