<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br>Hi Chris,</div><div><br>On Jan 17, 2015, at 4:45 PM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 17, 2015 at 4:03 PM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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">Hi,<div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Jan 17, 2015 at 10:35 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@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">Hi Frank,<br>
<span><br>
On Jan 17, 2015, at 3:39 AM, Frank Shearar &lt;<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>&gt; wrote:<br>
<br>
&gt; On 16 January 2015 at 21:44,&nbsp; &lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt; wrote:<br>
&gt;&gt; Chris Muller uploaded a new version of System to project The Trunk:<br>
&gt;&gt; <a href="http://source.squeak.org/trunk/System-cmm.694.mcz" target="_blank">http://source.squeak.org/trunk/System-cmm.694.mcz</a><br>
&gt;&gt;<br>
&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;<br>
&gt;&gt; Name: System-cmm.694<br>
&gt;&gt; Author: cmm<br>
&gt;&gt; Time: 16 January 2015, 3:44:19.079 pm<br>
&gt;&gt; UUID: e79a2347-2f40-4fec-8f00-f67ecad68491<br>
&gt;&gt; Ancestors: System-dtl.693<br>
&gt;&gt;<br>
&gt;&gt; - #flush stdout and stderr after writing error information to them.<br>
&gt;&gt; - After that, if the exception is resumable (i.e. a Warning), resume it.&nbsp; Except if its a MessageNotUnderstood -- that is not an error you want to resume in a headless environment.<br>
&gt;<br>
&gt; Why? It's probably a rare use case for a #run: script to catch MNUs to<br>
&gt; do something fancy, I guess? Maybe it's because #run: is usually<br>
&gt; (always?) the top level of the program?<br>
<br>
</span>One reason is that resuming an MNU simply resends from the diesNotUnderstand: method, so resuming will result in infinite recursion.&nbsp; I suppose the handler could allow one repeat but that seems arbitrary.&nbsp; There's nothing to stop one including a resuming MNU handler in the expression if one wants to override the default behaviour.<br>
<span><br>
&gt;<br>
&gt; Catching only MNUs seems very specific. Maybe there could be a #run:<br>
&gt; version that says "and here's a function you can use to control which<br>
&gt; exceptions are OK to resume, and which not"?<br>
<br>
</span>Well there is Notification and Warning but (rightly) MessageNotUnderstood is an Error.&nbsp; Reporting Notifications and Warnings to the output and continuing, but aborting for other exceptions seems the right thing to do, rather than basing it in resumability, yes?&nbsp; What am I missing?<br>
<br>
Whether an exception is resumability or not is to do with whether one can usefully provide a value with which to continue, not to do with the severity of the error.&nbsp; For example, being able to resume with nil for a permissions violation when opening a file or directory might make it really easy to implement a find(1) like search over directories where some may be unreadable due to permissions.&nbsp; Being able to resume doesn't make the permissions violation any the less severe, but it dies give us a nice way if handling it, certainly less complex than having to explicitly check for permissions during the traversal.&nbsp; Likewise, being able to substitute a value for an MNU allows all sorts of conveniences, eg see my code for disassembling methods to bytecode messages.<br>
<br>
So IMO the system should be reporting Notifications and Warnings and aborting for anything else.<br>
<br>
&gt;<br>
&gt; frank<br>
<br>
Eliot (phone)</blockquote><div><br></div></div></div><div>See the Error handler in&nbsp;<span style="color:rgb(0,0,0);font-size:13px">SmalltalkImage&gt;&gt;run:</span></div><span class=""><div><br></div><div>&nbsp;<span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on: Error</span></div><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do:</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ : err | err printVerboseOn: FileStream stderr.</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileStream stderr flush.</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(err isResumable and: [ (err isKindOf: MessageNotUnderstood) not ])</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifTrue: [ err resume ]</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse: [ self haltOrQuit ] ]!</span><br style="color:rgb(0,0,0);font-size:13px"><span style="color:rgb(0,0,0);font-size:13px">-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self haltOrQuit.</span><br style="color:rgb(0,0,0);font-size:13px"><div><span style="color:rgb(0,0,0);font-size:13px">-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;err isResumable ifTrue: [ err resume ] ]!</span>&nbsp;</div></span></div><br><br>IMO, this should read<br clear="all"><div><br></div><div><div><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on: Error</span></div><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do:</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ : err |</span></div><div><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:rgb(0,0,0);font-size:13px">&nbsp;&nbsp;</span><span style="font-size:13px;color:rgb(0,0,0)">err printVerboseOn: FileStream stderr.</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileStream stderr flush.</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="font-size:13px;color:rgb(0,0,0)">self haltOrQuit</span><span style="font-size:13px;color:rgb(0,0,0)">]!</span>&nbsp;</div><div><br></div><div>Resuming is definitely not safe; it could cause the software to attempt something damaging right?&nbsp; And whatever is caught here is an error, no haltOrWuit is the only valid response, no?&nbsp; I'm happy to make the change.</div></div></div></blockquote><div><br></div><div>Actually, I think I should put it back to my original code.</div><div><br></div><div><div><div><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on: Error</span></div><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;do:</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [ : err |</span></div><div><span style="color:rgb(0,0,0);font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><span style="color:rgb(0,0,0);font-size:13px">&nbsp;&nbsp;</span><span style="font-size:13px;color:rgb(0,0,0)">err printVerboseOn: FileStream stderr.</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FileStream stderr flush.</span><br style="font-size:13px;color:rgb(0,0,0)"><span style="font-size:13px;color:rgb(0,0,0)">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;err isResumable ifTrue: [&nbsp;</span><span style="font-size:13px;color:rgb(0,0,0)">self haltOrQuit ]&nbsp;</span><span style="font-size:13px;color:rgb(0,0,0)">]!</span>&nbsp;</div></div><div><br></div><div>That way, if its headless, it'll exit every time.&nbsp; If it's headful, the user will have the chance to fix the Error before clicking Proceed in the debugger.</div></div></div></div></div></blockquote><div><br></div>Agreed. &nbsp;That's good behavior. &nbsp;But it's entirely non-obvious that that's the effect of<div><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: 13px; ">&nbsp; &nbsp; &nbsp; &nbsp;err isResumable ifTrue: [</span><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); font-size: 13px; ">self haltOrQuit]</span></div><div><span style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);"><br></span></div><div><span style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">So there needs to be a comment immediately before that statement that explains what happens, just</span></div><div><span style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);"><br></span></div><div><span style="font-size: 15px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469);">"I</span><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">f we're headless, this will exit every time.&nbsp; If&nbsp;</span><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">we're</span><span style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.292969); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">&nbsp;headful, the user will have the chance to fix the Error before clicking Proceed in the debugger."</span><div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><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 class="gmail_extra"><span class=""><font color="#888888">-- <br><div>best,<div>Eliot</div></div>
</font></span></div></div>
<br><br>
<br></blockquote></div><br></div></div>
</div></blockquote><blockquote type="cite"><div><span></span><br></div></blockquote></div></div></body></html>