Structure.st
changeset 4170 78e576bb587c
parent 4169 a5c8df72bfca
child 4248 6ad8e090ff16
--- a/Structure.st	Mon Jul 24 16:17:45 2017 +0200
+++ b/Structure.st	Mon Jul 24 16:45:19 2017 +0200
@@ -1237,18 +1237,25 @@
     sel := aMessage selector.
     args := aMessage arguments.
 
+    (sel == #displayOn:) ifTrue:[
+        s := args at:1.
+        s nextPutAll:'Structure('.
+        names := self allInstVarNames.
+        names notNil ifTrue:[
+            names keysAndValuesDo:[:idx :nm |
+                s nextPutAll:nm; nextPutAll:'->'.
+                (self at:idx) displayOn:s.
+                s space
+            ].
+        ].
+        s nextPut:$).
+        ^ self.
+    ].
+
     (sel == #displayString) ifTrue:[
-       s := CharacterWriteStream with:'Structure('.
-       names := self allInstVarNames.
-       names notNil ifTrue:[
-           names keysAndValuesDo:[:idx :nm |
-               s nextPutAll:nm; nextPutAll:'->'.
-               s nextPutAll:(self at:idx) displayString.
-               s space
-           ].
-       ].
-       s nextPut:$).
-       ^ s contents
+        s := CharacterWriteStream on:''.
+        self displayOn:s.
+        ^ s contents
     ].
 
     sel == #basicInspect ifTrue:[
@@ -1398,6 +1405,12 @@
     sel == #respondsTo: ifTrue:[
          ^ false
     ].
+    sel == #canUnderstand: ifTrue:[
+        methodDictionary isNil ifTrue:[
+            ^ false
+        ].
+        ^ methodDictionary includesKey:(args at:1).
+    ].
     sel == #whichClassIncludesSelector: ifTrue:[
          ^ nil
     ].
@@ -1476,7 +1489,7 @@
 
     "Created: / 13-05-1996 / 20:22:22 / cg"
     "Modified: / 16-07-2017 / 13:54:58 / cg"
-    "Modified: / 24-07-2017 / 15:56:14 / stefan"
+    "Modified (format): / 24-07-2017 / 16:43:06 / stefan"
 ! !
 
 !Structure class methodsFor:'documentation'!