From: Robert Klemme Date: 2004-02-09T06:41:26+09:00 Subject: Re: RCR draft for enhanced "case..when..else..end" syntax "Gennady" schrieb im Newsbeitrag news:401FD2C6.1010703@tonesoft.com... > Robert Klemme wrote: > > "Gennady" schrieb im Newsbeitrag > > news:401FC5BB.10809@tonesoft.com... > > > >>Guoliang Cao wrote: > >> > >>>Hi, > >>> > >>>I'm thinking of submitting a RCR. Here is the draft. Comments are > > > > welcome. > > > >>>Thanks, > >>>Cao > >> > >>Do you know about this syntax currently available? > >> > >>a = "aaa" > >>b = "bbb" > >>case > >> when a == "aaa", b == "bbb" > >> puts "Lowercase detected" > >> when a == "AAA", b == "BBB" > >> puts "Uppercase detected" > >> else > >> puts "Detection failed" > >>end > > > > > > Since which version of Ruby? Thx! > > > > robert > > > > > > I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning > it on ruby-talk some time ago. I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures of Ruby"... :-) Thanks! robert