From: Lee Jarvis Date: 2007-12-21T20:48:33+09:00 Subject: Re: Problem with case statements Jes炭s Gabriel y Gal叩n wrote: > if you want to put the body of the when in the same line you need a > then keyword: 1.8.6 works with a keyword or a colon, I think this is what Hemant means.. 1.9 obviously doesn't support using them (I can't test it right now) >> def find(*args) >> case args.first >> when :first: puts "first" >> when :all: puts "all" >> else raise "invalid" >> end >> end => nil >> find :first, 1, 2, 3, 4 first As you can see, Hemants example works fine with colons in 1.8.6, perhaps not in 1.9, though... I normally use 'then' in either case.. Regards, Lee -- Posted via http://www.ruby-forum.com/.