extensions.st
changeset 12768 c88af8fef47e
parent 12661 4739a38172dc
child 12780 c2adddc0328e
--- a/extensions.st	Mon May 27 10:14:59 2013 +0200
+++ b/extensions.st	Mon May 27 10:30:52 2013 +0200
@@ -173,28 +173,30 @@
 inspectorExtraAttributes
     "extra (pseudo instvar) entries to be shown in an inspector."
 
+    |basePrinter|
+
+    basePrinter := 
+        [:arr :b |
+            String
+                streamContents:[:s |
+                    arr class isWords ifTrue:[
+                        arr asWordArray printOn:s base:b showRadix:true
+                    ] ifFalse:[
+                        arr class isLongs ifTrue:[
+                            arr asLongIntegerArray printOn:s base:b showRadix:true
+                        ] ifFalse:[
+                            arr asByteArray printOn:s base:b showRadix:true
+                        ]
+                    ]
+                ]
+        ].
+
     ^ Dictionary new
         declareAllNewFrom:(super inspectorExtraAttributes ? #());
         add:'-hexstring' -> [ self hexPrintString "WithSeparator:Character space" ];
-        add:'-hexadecimal' ->
-            [
-                String
-                    streamContents:[:s |
-                        self class isWords ifTrue:[
-                            self asWordArray printOn:s base:16 showRadix:true
-                        ] ifFalse:[
-                            self class isLongs ifTrue:[
-                                self asLongIntegerArray printOn:s base:16 showRadix:true
-                            ] ifFalse:[
-                                self asByteArray printOn:s base:16 showRadix:true
-                            ]
-                        ]
-                    ]
-            ];
+        add:'-hexadecimal' -> [ basePrinter value:self value:16 ];
+        add:'-binary' -> [ basePrinter value:self value:2 ];
         yourself
-
-    "Created: / 18-09-2006 / 21:29:59 / cg"
-    "Modified: / 06-10-2006 / 13:57:20 / cg"
 ! !
 
 !Change methodsFor:'private'!
@@ -2005,5 +2007,12 @@
 !stx_libtool class methodsFor:'documentation'!
 
 extensionsVersion_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.105 2013-04-14 12:40:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.106 2013-05-27 08:30:52 cg Exp $'
 ! !
+
+!stx_libtool class methodsFor:'documentation'!
+
+extensionsVersion_SVN
+    ^ 'Id:'
+! !
+