From: Matthew Smillie Date: 2006-07-28T21:47:54+09:00 Subject: Re: Weird problem with case expressions On Jul 28, 2006, at 13:41, dblack@wobblini.net wrote: > 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. Ah, that would explain it. I admit the method/variable ambiguity didn't even occur to me. matthew smillie.