<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"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></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"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>></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'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'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 "blocks" reads</div>
<div>
<p>"If a block has no <block body> or no <statements> in its <block body> then the value of the block is undefined."</p></div><div>I'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'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 & 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"><<a href="mailto:dsblakewatson@gmail.com" target="_blank">dsblakewatson@gmail.com</a>></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">>> | myBlock |</span><br style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<span style="font-family:arial,sans-serif;font-size:12.727272033691406px">>> 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">>> myBlock value: 'hello' value: 'there'</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'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>