------ art_11945_22592612.1199806120119 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Use semicolons. I would venture to say that this isn't supposed to work in 1.8 either and is fixed for 1.9 a f true; 1 else; 2; end Of course, this *should* be written as: a rue ? 1 : 2 Jason On Jan 8, 2008 10:20 AM, Florian Frank <flori / nixe.ping.de> wrote: > Hello, > > I stumbled across some syntax changes, and I don't know if they are > intended that way or oversights. > > 1. This doesn't work anymore in Ruby 1.9 and causes this error message: > > syntax error, unexpected ':', expecting keyword_then or ';' or '\n' > > a f true: 1 else 2 end > > 2. This prints 1, 2, and 3 in Ruby 1.8: > > b 1,2,3] > loop { > a f true then b.shift or break end > p a > } > > In 1.9 the 'b.shift or break' causes a "void value expression" error, > even though the expression does return a non-void value three times. I > admit, that this is rather hackish code, though. ;) > > Maybe you want to luck into it. Thanks. > > -- > Florian Frank > > > ------ art_11945_22592612.1199806120119 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Use semicolons. I would venture to say that this isn't supposed to work in 1.8 either and is fixed for 1.9<br><br>a f true; 1 else; 2; end<br><br>Of course, this *should* be written as:<br><br>a rue ? 1 : 2<br><br> Jason<br><br><div class mail_quote">On Jan 8, 2008 10:20 AM, Florian Frank <<a href ailto:flori / nixe.ping.de">flori / nixe.ping.de</a>> wrote:<br><blockquote class mail_quote" styleorder-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hello,<br><br>I stumbled across some syntax changes, and I don't know if they are<br>intended that way or oversights.<br><br>1. This doesn't work anymore in Ruby 1.9 and causes this error message:<br><br>syntax error, unexpected ':', expecting keyword_then or ';' or '\n' <br><br>a f true: 1 else 2 end<br><br>2. This prints 1, 2, and 3 in Ruby 1.8:<br><br>b 1,2,3]<br>loop {<br> a f true then b.shift or break end<br> p a<br>}<br><br>In 1.9 the 'b.shift or break' causes a "void value expression" error, <br>even though the expression does return a non-void value three times. I<br>admit, that this is rather hackish code, though. ;)<br><br>Maybe you want to luck into it. Thanks.<br><br>--<br><font color 888888">Florian Frank <br><br><br></font></blockquote></div><br> ------ art_11945_22592612.1199806120119--