Symbol.st
changeset 13423 716d670cb422
parent 13389 5049635eaa51
child 13471 1054964b45e6
--- a/Symbol.st	Tue Jun 28 20:09:51 2011 +0200
+++ b/Symbol.st	Tue Jun 28 20:11:40 2011 +0200
@@ -143,6 +143,7 @@
     "Created: 18.4.1997 / 20:52:20 / cg"
 ! !
 
+
 !Symbol class methodsFor:'queries'!
 
 findInterned:aString
@@ -182,6 +183,8 @@
 
 ! !
 
+
+
 !Symbol methodsFor:'Compatibility-Squeak'!
 
 isUnary
@@ -234,8 +237,40 @@
     ^ super basicAt:index put:something
 
     "Modified: 19.4.1996 / 11:16:10 / cg"
+!
+
+nameSpace
+    ^ self isNameSpaceSelector 
+        ifTrue: [ self nameSpaceAndSelector first  ]
+        ifFalse:[ nil ]
+
+    "Created: / 20-07-2010 / 10:41:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+nameSpaceAndSelector
+    |nsPart selPart idx ns|
+
+    self isNameSpaceSelector ifFalse:[
+        ^ Array with:nil with:self
+    ].
+    idx := self indexOf:$: startingAt:3.
+    nsPart := self copyFrom:2 to:idx - 1.
+    ns := Smalltalk at:nsPart asSymbol.
+    selPart := self copyFrom:idx + 2.
+    ^ Array with:ns with:selPart asSymbol
+
+    "Created: / 20-07-2010 / 10:23:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+selector
+    ^ self isNameSpaceSelector 
+        ifTrue: [ self nameSpaceAndSelector second ]
+        ifFalse:[ self ]
+
+    "Created: / 20-07-2010 / 10:41:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+
 !Symbol methodsFor:'comparing'!
 
 = something
@@ -698,10 +733,10 @@
 
 !Symbol class methodsFor:'documentation'!
 
-version
-    ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.93 2011-06-20 12:59:51 cg Exp $'
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.94 2011-06-28 18:11:40 vrany Exp $'
 !
 
-version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Symbol.st,v 1.93 2011-06-20 12:59:51 cg Exp $'
+version_SVN
+    ^ ' Id: Symbol.st 10648 2011-06-23 15:55:10Z vranyj1  '
 ! !