From: Daniel Schierbeck Date: 2006-07-28T21:50:09+09:00 Subject: Re: Weird problem with case expressions Carlos wrote: > 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. if expressions have this syntax as well: if foo: "bar" elsif bar: "foo" end Daniel