<div dir="ltr"><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 31, 2020 at 6:00 PM Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 31, 2020 at 2:00 PM Florin Mateoc <<a href="mailto:florin.mateoc@gmail.com" target="_blank">florin.mateoc@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div dir="ltr">I think this is especially confusing since the comment says that the primitive always fails, and then the expectation is that the Smalltalk code that follows is executed instead. But that code does not do what the method actually does<br></div></blockquote><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I disagree.  It does exactly what the method does (it *is* the implementation of the method) unless the stack is unwound.  Yes, the comment could point the reader to <span style="color:rgb(0,0,0)">Context>>#resume:through: which runs the ensure: & ifCurtailed: blocks on unwind.  Bit otherwise ifCurtailed: is not somehow magically not executed.  It is what it is ;-)</span></font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">As I said earlier, <span style="color:rgb(0,0,0)"> ifCurtailed: only evaluates its argument if a non-local return or exception return is taken and the normal return path is not taken.  See Context>>#resume:through: which runs the ensure: & ifCurtailed: blocks.</span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(0,0,0)">Can I confirm that your dissatisfaction is with the comment?  Or do you really think the ifCurtailed: method does not execute verbatim in the absence of unwinds?  If the former, you're welcome to submit an improved comment.  If the latter, you're mistaken.</span></font></div><div><span style="color:rgb(0,0,0)"><br></span></div></div></div></div></div></blockquote><div><br></div><div><br></div><div>
<div>Of course I agree that the 
ifCurtailed: method does execute verbatim in the absence of unwind. But the method does not only execute in the absence of unwinds. So my "dissatisfaction" is not just with the comment. While it could be somewhat be addressed by a comment, I think this is an instance where the vm is caught cheating. The shown Smalltalk code is not what gets executed in the presence of unwinds (as opposed to the code shown in #ensure: ). The execution of the argument block is hidden inside the vm<br></div><br></div></div></div>