From: Carlos Date: 2006-07-28T20:57:32+09:00 Subject: Re: Weird problem with case expressions Daniel Schierbeck wrote: > I have no problem doing this: > > if foo :bar then > ... > end > > Yet when I do this: > > case "foo" > when bar :baz then "bur" > end > > I get the following syntax error: > > SyntaxError: compile error > (irb):30: parse error, unexpected tSYMBEG, expecting kDO or '{' or '(' > when bar :baz then "bur" > ^ > > Is this intentional? Having the expression span multiple lines doesn't > solve it. case/when have an "alternative syntax": case "foo" when bar: "bur" end probably this syntax is clashing with your construction. --