<div dir="ltr">Hi Denis,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 7, 2016 at 7:54 AM, Denis Kudriashov <span dir="ltr">&lt;<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Look at example:<br><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><br></div><div>methodA</div><div>  | result |</div><div>  result := false.</div><div>  [result := self methodB] ensure: [result ifTrue: [...]]</div><div><br></div><div>methodB</div><div>   result := 1 &lt; 2.<br></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>  ^result</div></blockquote><div><br></div><div>Imagine now that methodB starts execution in context of call inside methodA.</div><div>Is it possible to terminate process at point of methodB return (^result)? </div><div>In that case ensure block in methodA will perform wrong logic.</div></div>
</blockquote></div><br>Returns are not suspension points, so no.  In the Cog and Stack VMs the only suspension points are backward jumps (at the end of while loops) and method activations.  Note that invocations of methods with primitives (including quick methods, e.g. ^true or ^instVar) are not suspension points, unless their primitives fail, or unless the primitives are suspend, wait et al. </div><div class="gmail_extra"><br></div><div class="gmail_extra">In the interpreter VM (incorrectly IMO) primitive invocation in the context of a perform:, tryPrimitive:, executeMethod: primitive is also a suspension point.  i.e. /any/ primitive including a quick primitive invoked via primitives 83, 84, 100, 188, 188 &amp; 189, could potentially be a suspension point, in which case the process would be suspended immediately following the send that invoked the primitive.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>