<div dir="ltr">I went one step further and simply pass Errors and letting default handler resume them if they are resumable.<div><br></div><div>Since the code is now so explicit about quitting or passing, it seems a comment is not needed.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 17, 2015 at 7:00 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris Muller uploaded a new version of System to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/System-cmm.696.mcz" target="_blank">http://source.squeak.org/trunk/System-cmm.696.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: System-cmm.696<br>
Author: cmm<br>
Time: 17 January 2015, 7:00:32.693 pm<br>
UUID: e13e847b-b9e1-4068-bb77-48d54a9cd005<br>
Ancestors: System-kfr.695, System-cmm.694<br>
<br>
- Remove the crazy check for MessageNotUnderstood in Smalltalk #run:..  Headless mode should always exit on any Error.<br>
- In fact, even when not in headless mode, we don&#39;t need to halt but simply #pass the Error to the default handler for Errors do what it does, whether that&#39;s popping a debugger which could be resumed (if the Error isResumable) or something else.<br>
<br>
=============== Diff against System-kfr.695 ===============<br>
<br>
Item was removed:<br>
- ----- Method: SmalltalkImage&gt;&gt;haltOrQuit (in category &#39;command line&#39;) -----<br>
- haltOrQuit<br>
-       self isHeadless<br>
-               ifTrue:<br>
-                       [ self<br>
-                               snapshot: false<br>
-                               andQuit: true ]<br>
-               ifFalse: [ self halt ]!<br>
<br>
Item was changed:<br>
  ----- Method: SmalltalkImage&gt;&gt;run: (in category &#39;command line&#39;) -----<br>
+ run: aBlock<br>
- run: aBlock<br>
        [ [ (aBlock numArgs = 1 and: [ self arguments size &gt; 1 ])<br>
+               ifTrue: [ &quot;Allow a large, variable number of arguments to be passed as an Array to aBlock.&quot;<br>
-               ifTrue:<br>
-                       [ &quot;Allow a large, variable number of arguments to be passed as an Array to aBlock.&quot;<br>
                        aBlock value: self arguments ]<br>
                ifFalse: [ aBlock valueWithEnoughArguments: self arguments ] ]<br>
                on: ProgressInitiationException<br>
                do:<br>
                        [ : pie | &quot;Don&#39;t want to log this notification.&quot;<br>
                        pie defaultAction ] ]<br>
                on: Notification , Warning<br>
                do:<br>
                        [ : noti | FileStream stdout<br>
                                 nextPutAll: DateAndTime now asString ;<br>
                                 space ;<br>
                                 nextPutAll: noti description ;<br>
                                 cr.<br>
                        noti resume ]<br>
                on: SyntaxErrorNotification<br>
                do:<br>
                        [ : err | FileStream stdout<br>
                                 nextPutAll: err errorCode ;<br>
+                                cr; flush.<br>
+                       self isHeadless<br>
+                               ifTrue: [ self snapshot: false andQuit: true ]<br>
+                               ifFalse: [ err pass ] ]<br>
-                                cr.<br>
-                       self haltOrQuit ]<br>
                on: Error<br>
                do:<br>
                        [ : err | err printVerboseOn: FileStream stderr.<br>
+                       FileStream stderr flush.<br>
+                       self isHeadless<br>
+                               ifTrue: [ self snapshot: false andQuit: true ]<br>
+                               ifFalse: [ err pass ] ]!<br>
-                       self haltOrQuit.<br>
-                       err isResumable ifTrue: [ err resume ] ]!<br>
<br>
Item was changed:<br>
  ----- Method: SmalltalkImage&gt;&gt;vmStatisticsReportString (in category &#39;vm statistics&#39;) -----<br>
  vmStatisticsReportString<br>
        &quot;(Workspace new contents: Smalltalk vmStatisticsReportString)<br>
                openLabel: &#39;VM Statistics&#39;&quot;<br>
        &quot;StringHolderView<br>
                open: (StringHolder new contents: Smalltalk vmStatisticsReportString)<br>
                label: &#39;VM Statistics&#39;&quot;<br>
<br>
        | params onSpur oldSpaceEnd youngSpaceEnd memorySize fullGCs fullGCTime incrGCs incrGCTime tenureCount upTime upTime2 fullGCs2 fullGCTime2 incrGCs2 incrGCTime2 tenureCount2 str freeSize youngSize used |<br>
        params := self getVMParameters.<br>
+       onSpur := (params at: 41 ifAbsent: [ 0 ]) anyMask: 16.<br>
-       onSpur := (params at: 41) anyMask: 16.<br>
        oldSpaceEnd                     := params at: 1.<br>
        youngSpaceEnd           := params at: 2.<br>
        memorySize                      := params at: 3.<br>
        fullGCs                         := params at: 7.<br>
        fullGCTime                      := params at: 8.<br>
        incrGCs                         := params at: 9.<br>
        incrGCTime                      := params at: 10.<br>
        tenureCount                     := params at: 11.<br>
        upTime := Time millisecondClockValue.<br>
<br>
        str := WriteStream on: (String new: 700).<br>
        str     nextPutAll: &#39;uptime                     &#39;;<br>
                print: (upTime / 1000 / 60 // 60); nextPut: $h;<br>
                print: (upTime / 1000 / 60 \\ 60) asInteger; nextPut: $m;<br>
                print: (upTime / 1000 \\ 60) asInteger; nextPut: $s; cr.<br>
<br>
        str     nextPutAll: &#39;memory             &#39;;<br>
                nextPutAll: memorySize asStringWithCommas; nextPutAll: &#39; bytes&#39;; cr.<br>
        str     nextPutAll:     &#39;       old                     &#39;;<br>
                nextPutAll: oldSpaceEnd asStringWithCommas; nextPutAll: &#39; bytes (&#39;;<br>
                print: (oldSpaceEnd / memorySize * 100) maxDecimalPlaces: 1; nextPutAll: &#39;%)&#39;; cr.<br>
        youngSize := onSpur<br>
                                                ifTrue: [params at: 44 &quot;eden size&quot;] &quot;Spur&quot;<br>
                                                ifFalse:  [youngSpaceEnd - oldSpaceEnd]. &quot;Squeak V3&quot;<br>
        str     nextPutAll: &#39;   young           &#39;;<br>
                nextPutAll: youngSize asStringWithCommas; nextPutAll: &#39; bytes (&#39;;<br>
                print: youngSize / memorySize * 100 maxDecimalPlaces: 1; nextPutAll: &#39;%)&#39;; cr.<br>
        onSpur ifTrue: [youngSize := youngSpaceEnd &quot;used eden&quot;].<br>
        freeSize := onSpur<br>
                                                ifTrue: [(params at: 54) + (params at: 44) - youngSize] &quot;Spur&quot;<br>
                                                ifFalse:  [memorySize - youngSpaceEnd] &quot;Squeak V3&quot;.<br>
        used := onSpur<br>
                                ifTrue: [youngSize + oldSpaceEnd - freeSize] &quot;Spur&quot;<br>
                                ifFalse:  [youngSpaceEnd]. &quot;Squeak V3&quot;<br>
        str     nextPutAll: &#39;   used            &#39;;<br>
                nextPutAll: used asStringWithCommas; nextPutAll: &#39; bytes (&#39;;<br>
                print: used / memorySize * 100 maxDecimalPlaces: 1; nextPutAll: &#39;%)&#39;; cr.<br>
        str     nextPutAll: &#39;   free            &#39;;<br>
                nextPutAll: freeSize asStringWithCommas; nextPutAll: &#39; bytes (&#39;;<br>
                print: freeSize / memorySize * 100 maxDecimalPlaces: 1; nextPutAll: &#39;%)&#39;; cr.<br>
<br>
        str     nextPutAll: &#39;GCs                        &#39;;<br>
                nextPutAll: (fullGCs + incrGCs) asStringWithCommas.<br>
        fullGCs + incrGCs &gt; 0 ifTrue: [<br>
                str<br>
                        nextPutAll: &#39; (&#39;;<br>
                        print: (upTime / (fullGCs + incrGCs)) maxDecimalPlaces: 1;<br>
                        nextPutAll: &#39; ms between GCs)&#39;<br>
        ].<br>
        str cr.<br>
        str     nextPutAll: &#39;   full                    &#39;;<br>
                nextPutAll: fullGCs asStringWithCommas; nextPutAll: &#39; totalling &#39;; nextPutAll: fullGCTime asStringWithCommas; nextPutAll: &#39; ms (&#39;;<br>
                print: (fullGCTime / upTime * 100) maxDecimalPlaces: 1;<br>
                nextPutAll: &#39;% uptime)&#39;.<br>
        fullGCs = 0 ifFalse:<br>
                [str    nextPutAll: &#39;, avg &#39;; print: (fullGCTime / fullGCs) maxDecimalPlaces: 1; nextPutAll: &#39; ms&#39;].<br>
        str     cr.<br>
        str     nextPutAll: &#39;   incr                    &#39;;<br>
                nextPutAll: incrGCs asStringWithCommas; nextPutAll: &#39; totalling &#39;; nextPutAll: incrGCTime asStringWithCommas; nextPutAll: &#39; ms (&#39;;<br>
                print: (incrGCTime / upTime * 100) maxDecimalPlaces: 1;<br>
                nextPutAll: &#39;% uptime), avg &#39;; print: (incrGCTime / incrGCs) maxDecimalPlaces: 1; nextPutAll: &#39; ms&#39;; cr.<br>
        str     nextPutAll: &#39;   tenures         &#39;;<br>
                nextPutAll: tenureCount asStringWithCommas.<br>
        tenureCount = 0 ifFalse:<br>
                [str nextPutAll: &#39; (avg &#39;; print: incrGCs // tenureCount; nextPutAll: &#39; GCs/tenure)&#39;].<br>
        str     cr.<br>
<br>
  LastStats ifNil: [LastStats := Array new: 6]<br>
  ifNotNil: [<br>
        upTime2 := upTime - (LastStats at: 1).<br>
        fullGCs2 := fullGCs - (LastStats at: 2).<br>
        fullGCTime2 := fullGCTime - (LastStats at: 3).<br>
        incrGCs2 := incrGCs - (LastStats at: 4).<br>
        incrGCTime2 := incrGCTime - (LastStats at: 5).<br>
        tenureCount2 := tenureCount - (LastStats at: 6).<br>
<br>
        str     nextPutAll: self textMarkerForShortReport ;<br>
                nextPutAll: (fullGCs2 + incrGCs2) asStringWithCommas.<br>
        fullGCs2 + incrGCs2 &gt; 0 ifTrue: [<br>
                str<br>
                        nextPutAll: &#39; (&#39;;<br>
                        print: upTime2 // (fullGCs2 + incrGCs2);<br>
                        nextPutAll: &#39; ms between GCs)&#39;.<br>
        ].<br>
        str cr.<br>
        str     nextPutAll: &#39;   uptime          &#39;; print: (upTime2 / 1000.0) maxDecimalPlaces: 1; nextPutAll: &#39; s&#39;; cr.<br>
        str     nextPutAll: &#39;   full                    &#39;;<br>
                nextPutAll: fullGCs2 asStringWithCommas; nextPutAll: &#39; totalling &#39;; nextPutAll: fullGCTime2 asStringWithCommas; nextPutAll: &#39; ms (&#39;;<br>
                print: (fullGCTime2 / upTime2 * 100) maxDecimalPlaces: 1;<br>
                nextPutAll: &#39;% uptime)&#39;.<br>
        fullGCs2 = 0 ifFalse:<br>
                [str    nextPutAll: &#39;, avg &#39;; print: (fullGCTime2 / fullGCs2) maxDecimalPlaces: 1; nextPutAll: &#39; ms&#39;].<br>
        str     cr.<br>
        str     nextPutAll: &#39;   incr                    &#39;;<br>
                nextPutAll: incrGCs2 asStringWithCommas; nextPutAll: &#39; totalling &#39;; nextPutAll: incrGCTime2 asStringWithCommas; nextPutAll: &#39; ms (&#39;;<br>
                print: (incrGCTime2 / upTime2 * 100) maxDecimalPlaces: 1;<br>
                nextPutAll: &#39;% uptime), avg &#39;.<br>
        incrGCs2 &gt; 0 ifTrue: [<br>
                 str print: (incrGCTime2 / incrGCs2) maxDecimalPlaces: 1; nextPutAll: &#39; ms&#39;<br>
        ].<br>
        str cr.<br>
        str     nextPutAll: &#39;   tenures         &#39;;<br>
                nextPutAll: tenureCount2 asStringWithCommas.<br>
        tenureCount2 = 0 ifFalse:<br>
                [str nextPutAll: &#39; (avg &#39;; print: incrGCs2 // tenureCount2; nextPutAll: &#39; GCs/tenure)&#39;].<br>
        str     cr.<br>
  ].<br>
        LastStats at: 1 put: upTime.<br>
        LastStats at: 2 put: fullGCs.<br>
        LastStats at: 3 put: fullGCTime.<br>
        LastStats at: 4 put: incrGCs.<br>
        LastStats at: 5 put: incrGCTime.<br>
        LastStats at: 6 put: tenureCount.<br>
<br>
        ^ str contents<br>
  !<br>
<br>
<br>
</blockquote></div><br></div>