<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#ffffff"><blockquote type="cite"><div dir="ltr"><div><div class="gmail_quote"><div>1) Would you be opposed to a #nonLocalReturn: method on
Exception? That seems to me a cleaner and clearer way of
doing this. It's also more consistent with how Exception
deals with the other scenarios.</div>
</div>
</div>
</div>
</blockquote>
<br>
I think #nonLocalReturn: would be ok. Maybe a better name could be
#methodReturn:<br></div></blockquote><div><br></div><div>I'm against the #nonLocalReturn: or #methodReturn: :-)</div><div>I think they do not solve anything (there is no problem currently) and they add accidental complexity that it is unnecessary.</div><div><br></div><div>Cheers!</div><div>Hernan</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#ffffff">
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_quote">
<div>2) Doh! I'm not sure if I did the double-signaling or
if that was from the original OMeta code. Either way, it
was a dumb thing to do and entirely unnecessary in this
case as your changes show. The 'only signaled once!' part
warrants discussion/clarification...</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#ffffff"> <br>
Finally, I suggest adding yet another change set to Cuis
that could break existing but wrong code: 3924*.<a href="http://cs.st" target="_blank">cs.st</a> attached throws an error if
an exception is signaled twice.<br>
</div>
</blockquote>
<div><br>
</div>
<div>I guess it depends on what you are saying:</div>
<div><br>
</div>
<div>1) We think signaling twice is bad form and logically
inconsistent and so you shouldn't do it (to me that's not
an error, but is something we should capture and
*optionally* report to the user... I'm working on another
email/changeset related to this case.)</div>
<div><br>
</div>
<div>2) In Cuis, for implementation reasons, signaling twice
is an error and can not be done (define twice... read
on...)</div>
<div><br>
</div>
<div>While what you are saying re: not re-signaling
logically makes sense as something to avoid in general, I
don't see anything in the ANSI spec explicitly either
allowing or forbidding it.[SPEC] That's not a big deal as
sometimes implementation decisions need to be made but I
think we need to be very clear here on what is/isn't
allowed:</div>
<div><br>
</div>
<div>1) You can't signal the exception from within its
handler block (i.e. you can signal the exception again
and/or recycle it, but only *after* the current signal has
been handled)</div>
<div><br>
</div>
<div>2) You can't re-signal an Exception ever (i.e. you can
recycle but not re-signal... meaning we need to have a
method to clear out relevant state for recycling)</div>
<div><br>
</div>
<div>3) You can't re-signal or recycle an Exception ever
(i.e. they are single-shot instances)</div>
<div><br>
</div>
<div>(However we go, it seems like comments on the class and
relevant methods are in order)</div>
<div><br>
</div>
<div>Seriously, I didn't just make this up.... recycling is
a real use case. If you read my final note on <a href="https://github.com/pbella/OMeta-Cuis" target="_blank">https://github.com/pbella/OMeta-Cuis</a>,
the 'original' OMeta implementation actually did recycle
exceptions as a performance enhancement. It did this by
re-signaling the existing instance since there was no
formal mechanism for recycling. I removed the feature due
to the implementation leaking (on the OMeta side not the
Exception side, IIRC) and had planned to re-implement it
(sans leak) at some point. So I'm wondering if that is
something that is supported or not.</div>
</div>
</div>
</div>
</blockquote>
<br>
I'm pretty sure re-signaling an exception instance while it is being
handled shouldn't be allowed. An exception has a (single)
signalContext. The design can't handle more than one.<br>
<br>
To enable re-signaling an already handled exception instance, I
guess it could be enough to clear ivar 'signalContext' in the
ifCurtailed: block in #evaluateHandlerBlock: . Then,
<a href="http://3924-SignalExceptionsOnlyOnce-JuanVuletich-2019Oct16-18h52m-jmv.1.cs.st" target="_blank">3924-SignalExceptionsOnlyOnce-JuanVuletich-2019Oct16-18h52m-jmv.1.cs.st</a>
would stay.<br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_quote">
<div><br>
</div>
<div>This is all near and dear to me because, as you
probably noticed, Exception is the spine of OMeta's
control flow. If you change/break one, you probably
change/break the other.</div>
</div>
</div>
</div>
</blockquote>
<br>
Yep. It is a good test bed.<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#ffffff"> <br>
Please review.<br>
Thanks,<br>
<pre cols="72">--
Juan Vuletich</pre>
</div>
</blockquote>
<div><br>
</div>
<div>Thanks,</div>
<div>Phil</div>
<div><br>
</div>
<div>[SPEC] Just to clarify what I mean here. In section
5.5.4.2 they explicitly state in the Errors section where
#outer cannot be sent from. If they intended #signal to
not be called from somewhere in particular, I would expect
(ok, hope) to see that indicated somewhere for #signal as
well. Of course specs aren't perfect and there are any
number of reasons why this might not have been stated one
way or the other.</div>
</div>
</div>
</div>
</blockquote>
<br>
I'm pretty sure it was an oversight. Doing [ :ex | ex signal ] as a
handler block is asking for trouble. How can you know it will not
try to handle the new signal with the same handler, entering in an
endless recursion?<br>
<br>
Thanks,<br>
<pre cols="72">--
Juan Vuletich
<a href="http://www.cuis-smalltalk.org" target="_blank">www.cuis-smalltalk.org</a>
<a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a href="https://github.com/jvuletich" target="_blank">https://github.com/jvuletich</a>
<a href="https://www.linkedin.com/in/juan-vuletich-75611b3" target="_blank">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal"><span style="font-weight:bold">Hernán Wilkinson</span><br>Agile Software Development, Teaching & Coaching</span></font></span></span></span></strong></span></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">Phone: +54-011</span></font></span></span></span></strong></span><font face="tahoma, sans-serif" size="2">-4893-2057</font></div><div><strong style="font-family:tahoma,sans-serif;font-size:xx-small"><span style="font-size:8pt"><span style="font-size:small"><font size="2"><span style="font-weight:normal">Twitter: @HernanWilkinson</span></font></span></span></strong></div><div><span style="font-family:tahoma,sans-serif;font-size:xx-small;border-collapse:collapse"><strong><span style="font-size:8pt"><span><span style="font-size:small"><font size="2"><span style="font-weight:normal">site: <a href="http://www.10pines.com/" style="color:rgb(17,65,112)" target="_blank">http://www.10Pines.com</a></span></font></span></span></span></strong></span></div><div><font face="tahoma, sans-serif"><span style="border-collapse:collapse">Address: Alem 896</span></font>, Floor 6, Buenos Aires, Argentina</div></div></div></div></div></div></div></div></div></div></div></div></div>