From: "Aleksi Niemelä" Date: 2000-07-04T18:34:14+02:00 Subject: [ruby-talk:03801] Immature idea for case-when I got an idea for enhancing (?) case-when. Now 'when' actually forces the use of '==='. What if not? case {|ancestor| obj.ancestors.include? ancestor} when Foo puts "Hey we have a Foo descendant here." when Bar puts "Blaahr." end This is actually quite ugly, but the point is clear. The better structure could be: case obj method_it_has when arguments_to, be_passed when args2 end Effectively same as: if obj.method_it_has(arguments_to, be_passed) elsif obj.method_it_has(args2) end Applied for same example: case obj.ancestors include? # now, how to make function references? when Foo puts "Hey we have a Foo descendant here." when Bar puts "Blaahr." end There might be some other interesting variations. Just to make it clear: I'm not saying this is good feature to have nor promoting this! This might be good, might need amount of tinkering before it's "right" or might be outright simple, plain wrong. Think about it, and tell me. (Or tell matz :). - Aleksi