Structure.st
changeset 4002 3df67527898f
parent 3981 69e822260845
child 4003 a22969f1ca9e
--- a/Structure.st	Wed Oct 05 14:24:39 2016 +0200
+++ b/Structure.st	Wed Oct 05 16:19:41 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1996 by Claus Gittinger
               All Rights Reserved
@@ -1238,9 +1236,6 @@
     args := aMessage arguments.
 
     (sel == #displayString) ifTrue:[
-        "sr: do not change this #printString or keep attention to change also:
-         Workflow::ActivityLogPinViewer #doInspect
-         better implement #isStructure"
        s := CharacterWriteStream with:'Structure('.
        names := self allInstVarNames.
        names notNil ifTrue:[
@@ -1286,14 +1281,14 @@
         ^ nil
     ].
 
-    (sel == #'perform:') ifTrue:[
+    (sel == #perform:) ifTrue:[
          ^ super perform:(args at:1)
     ].
-    (sel == #'perform:with:') ifTrue:[
+    (sel == #perform:with:) ifTrue:[
          ^ super perform:(args at:1) with:(args at:2)
     ].
 
-    (sel == #'=') ifTrue:[
+    (sel == #=) ifTrue:[
         (args at:1) class == (args at:1) ifFalse:[^ false].    "/ must be another struct
         names := self allInstVarNames.
         names notNil ifTrue:[
@@ -1308,22 +1303,19 @@
         ].
         ^ true.
     ].
-    (sel == #'~=') ifTrue:[
+    (sel == #~=) ifTrue:[
          ^ super ~= (args at:1)
     ].
 
-    (sel == #size
-    or:[sel == #basicSize]) ifTrue:[
+    (sel == #size or:[sel == #basicSize]) ifTrue:[
          ^ super basicSize
     ].
 
-    (sel == #at:
-    or:[sel == #basicAt:]) ifTrue:[
+    (sel == #at: or:[sel == #basicAt:]) ifTrue:[
          ^ super basicAt:(args at:1)
     ].
 
-    (sel == #at:put:
-    or:[sel == #basicAt:put:]) ifTrue:[
+    (sel == #at:put: or:[sel == #basicAt:put:]) ifTrue:[
          ^ super basicAt:(args at:1) put:(args at:2)
     ].
 
@@ -1343,13 +1335,16 @@
     (sel == #isException) ifTrue:[
          ^ false
     ].
+    (sel == #isStructure) ifTrue:[
+         ^ true
+    ].
+
 
     "/ class protocol
 
     sel == #name ifTrue:[
-        ^ 'Structure'
+        ^ #Structure
     ].
-
     sel == #isVariable ifTrue:[
          ^ false
     ].
@@ -1368,36 +1363,33 @@
     sel == #isKindOf: ifTrue:[
          ^ false
     ].
+    sel == #includesBehavior: ifTrue:[
+         ^ super includesBehavior:(args at:1)
+    ].
     sel == #isString ifTrue:[
          ^ false
     ].
     sel == #respondsTo: ifTrue:[
          ^ false
     ].
-
     sel == #whichClassIncludesSelector: ifTrue:[
          ^ nil
     ].
-
     sel == #evaluatorClass ifTrue:[
         ^ Compiler
     ].
-
     sel == #classNameWithArticle ifTrue:[
          ^ self displayString
     ].
-
     sel == #allSubclasses ifTrue:[
         ^ #()
     ].
-
     sel == #allClassVarNames ifTrue:[
         ^ #()
     ].
     sel == #methodDictionary ifTrue:[
-        ^methodDictionary
+        ^ methodDictionary
     ].
-
     sel == #allInstVarNames ifTrue:[
         methodDictionary isNil ifTrue:[
             'Structure [info]: oops - nil methodDict' infoPrintCR.
@@ -1435,8 +1427,7 @@
          ^ instSize
     ].
     'Structure [warning]: return nil for: ' infoPrint.
-    aMessage infoPrint.
-    ' args ' infoPrint. args infoPrintCR.
+    aMessage infoPrint.' args ' infoPrint. args infoPrintCR.
 "/ Object halt.
 
     ^ nil.