------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&#39;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 classmail_quote">On Jan 8, 2008 10:20 AM, Florian Frank &lt;<a hrefailto:flori / nixe.ping.de">flori / nixe.ping.de</a>&gt; wrote:<br><blockquote classmail_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&#39;t know if they are<br>intended that way or oversights.<br><br>1. This doesn&#39;t work anymore in Ruby 1.9 and causes this error message:<br><br>syntax error, unexpected &#39;:&#39;, expecting keyword_then or &#39;;&#39; or &#39;\n&#39;
<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> &nbsp;a  f true then b.shift or break end<br> &nbsp;p a<br>}<br><br>In 1.9 the &#39;b.shift or break&#39; causes a &quot;void value expression&quot; 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 color888888">Florian Frank
<br><br><br></font></blockquote></div><br>

------art_11945_22592612.1199806120119--