From: "Iñaki Baz Castillo" Date: 2011-07-14T17:56:28+09:00 Subject: Why return(XXX) is valid within a "value = case N ..." ? Hi, the following code does not "compile": ----------------------------- def test1 value = return("lalala") end ----------------------------- => SyntaxError: (irb):11: void value expression Ok, it makes sense. So then, why the following does not fail? ----------------------------- def test2 value = case 123 when Fixnum return "returning 'Fixnum' string from method test2" end puts "method test2 ends now" end -------------------------- irb> test2 => "returning 'Fixnum' string from method kk" I'm using Ruby 1.9.2 and in fact I use a method like "test2" it in my project, but it seems a bit strange for me and I would like to be sure that it's something correct (even if IMHO it does not make sense) and will not change in a future Ruby 1.9 version. Thanks a lot. -- Iñaki Baz Castillo