<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-12 19:17 GMT+02:00 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="">On Mon, May 12, 2014 at 10:05 AM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">I think I remember it was either the first or last parameter that was returned in old implementation<br>

</div></blockquote><div><br></div></div><div>the last. ([:a :b|] value: #first value: #last) == #last</div><div class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><br>It&#39;s a known problem: <a href="http://bugs.squeak.org/view.php?id=5793" target="_blank">http://bugs.squeak.org/view.php?id=5793</a><br>
<br>but I would have thought that this was fixed with Eliot&#39;s closure...<br></div></blockquote><div><br></div></div><div>I kept the old semantics, trying to rock the boat as little as possible.  I just checked the draft standard.  The end of 3.4.4 &quot;blocks&quot; reads</div>

<div>







<p>&quot;If a block has no &lt;block body&gt; or no &lt;statements&gt; in its &lt;block body&gt; then the value of the block is undefined.&quot;</p></div><div>I&#39;ve found the returning the last value bizarre for a while.  If others feel strongly we could fix it for 4.6/5.0.  But I&#39;d want agreement with Pharo.  Marcus what does Opal do with:</div>

<div><br></div><div>    [:a :b|] value: #first value: #last<br></div><div><br></div><div>?</div><div><br></div></div></div></div></blockquote><div><br>As I reported in the bug tracker, the NewCompiler (former nick name for Opal) answers nil.<br>
This can be considered as an extension of [] value...<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div></div><div>Squeak &amp; VW answer #last.</div><div class=""><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir="ltr"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-12 17:58 GMT+02:00 blake <span dir="ltr">&lt;<a href="mailto:dsblakewatson@gmail.com" target="_blank">dsblakewatson@gmail.com</a>&gt;</span>:<div>

<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">&gt;&gt; | myBlock |</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">


<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">&gt;&gt; myBlock := [ : arg1 : arg2 | ].</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">&gt;&gt; myBlock value: &#39;hello&#39; value: &#39;there&#39;</span><br></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>



</span></div></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">nil</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>



</span></div><div class="gmail_extra"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Because the block isn&#39;t returning a value and the last line is calling the block.</span></div></div>
<br><br>
<br></blockquote></div></div></div><br></div>
<br><br>
<br></blockquote></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</font></span></div></div>
<br><br>
<br></blockquote></div><br></div></div>