From: dblack@... Date: 2006-07-28T21:41:57+09:00 Subject: Re: Weird problem with case expressions Hi -- On Fri, 28 Jul 2006, Matthew Smillie wrote: > On Jul 28, 2006, at 12:45, Daniel Schierbeck wrote: > >> I have no problem doing this: >> >> if foo :bar then >> ... >> end > > Which is odd, 'cause I get this error: > > c = [something] > if c :foo then > puts "blah" > end > SyntaxError: compile error > (irb):3: parse error, unexpected kTHEN, expecting kEND > from (irb):5 > from :0 > > > What would you expect an expression of the form 'c :symbol' to mean in the > first place? I think in Daniel's example foo is a method, and :bar is a method argument. David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy http://www.manning.com/black => RUBY FOR RAILS (reviewed on Slashdot, 7/12/2006!) http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log dblack@wobblini.net => me