Smalltalk.st
branchjv
changeset 17850 8fa257692c35
parent 17849 30004e7fe0ae
child 17859 cc167a69671c
--- a/Smalltalk.st	Thu Aug 18 10:37:43 2011 +0100
+++ b/Smalltalk.st	Sat Aug 20 21:29:33 2011 +0100
@@ -2915,45 +2915,45 @@
      But be careful, to not invent new symbols ..."
     sym := aString asSymbolIfInterned.
     sym notNil ifTrue:[
-	cls := self at:sym ifAbsent:nil.
-	cls isBehavior ifTrue:[^ cls].
+        cls := self at:sym ifAbsent:nil.
+        cls isBehavior ifTrue:[^ cls].
     ].
 
     (aString endsWith:' class') ifTrue:[
-	nonMeta := self classNamed:(aString copyWithoutLast:6).
-	nonMeta notNil ifTrue:[
-	    ^ nonMeta theMetaclass
-	].
-    ].
-
-    "no success yet. Try if this is a private classes of an autoloaded class"
+        nonMeta := self classNamed:(aString copyWithoutLast:6).
+        nonMeta notNil ifTrue:[
+            ^ nonMeta theMetaclass
+        ].
+    ].
+
+    "no success yet. Try if this is a private class of an autoloaded class"
     cls isNil ifTrue:[
-	idx := aString indexOfSubCollection:'::'.
-	idx ~~ 0 ifTrue:[
-	    prefix := aString copyTo:idx-1.
-	    nsNameSymbol := prefix asSymbolIfInterned.
-	    nsNameSymbol notNil ifTrue:[
-		rest := aString copyFrom:idx+2.
-		namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
-		"namespace may be the owner of a private class.
-		 NameSpaces and Behaviors have the same protocol"
-		[namespace isBehavior] whileTrue:[
-		    idx := rest indexOfSubCollection:'::'.
-		    idx ~~ 0 ifTrue:[
-			prefix := rest copyTo:idx-1.
-			rest := rest copyFrom:idx+2.
-			"this does an implicit autoload if required"
-			namespace := namespace privateClassesAt:prefix.
-		    ] ifFalse:[
-			namespace isLoaded ifTrue:[
-			    cls := namespace privateClassesAt:rest.
-			    cls isBehavior ifTrue:[^ cls].
-			].
-			namespace := nil.   "force exit of loop"
-		    ].
-		].
-	    ].
-	].
+        idx := aString indexOfSubCollection:'::'.
+        idx ~~ 0 ifTrue:[
+            prefix := aString copyTo:idx-1.
+            nsNameSymbol := prefix asSymbolIfInterned.
+            nsNameSymbol notNil ifTrue:[
+                rest := aString copyFrom:idx+2.
+                namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
+                "namespace may be the owner of a private class.
+                 NameSpaces and Behaviors have the same protocol"
+                [namespace isBehavior] whileTrue:[
+                    idx := rest indexOfSubCollection:'::'.
+                    idx ~~ 0 ifTrue:[
+                        prefix := rest copyTo:idx-1.
+                        rest := rest copyFrom:idx+2.
+                        "this does an implicit autoload if required"
+                        namespace := namespace privateClassesAt:prefix.
+                    ] ifFalse:[
+                        namespace isLoaded ifTrue:[
+                            cls := namespace privateClassesAt:rest.
+                            cls isBehavior ifTrue:[^ cls].
+                        ].
+                        namespace := nil.   "force exit of loop"
+                    ].
+                ].
+            ].
+        ].
     ].
 
     ^ nil
@@ -2974,6 +2974,7 @@
     "Created: / 24-11-1995 / 17:30:22 / cg"
     "Modified: / 19-06-1996 / 14:22:21 / stefan"
     "Modified: / 23-10-2006 / 18:06:53 / cg"
+    "Modified (comment): / 20-08-2011 / 16:43:07 / cg"
 !
 
 classNames
@@ -3063,6 +3064,16 @@
     "Modified: / 10-08-2006 / 13:05:48 / cg"
 !
 
+hasClassNamed:aString 
+    Symbol 
+        hasInterned:aString
+        ifTrue:[:aSymbol | ^ (self at:aSymbol ifAbsent:[ nil ]) isClass ].
+    ^ false
+
+    "Created: / 26-08-2009 / 11:43:03 / Jaroslav Havlin <havlij6@fel.cvut.cz>"
+    "Modified: / 20-08-2011 / 16:41:31 / cg"
+!
+
 hasNameSpaces
     "can be redefined by dummy namespaces/environments, to suppress
      the namespace display in a browser (PocketSmalltalk)"
@@ -7641,11 +7652,11 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Smalltalk.st 10669 2011-08-18 09:37:43Z vranyj1 $'
+    ^ '$Id: Smalltalk.st 10672 2011-08-20 20:29:33Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.972 2011/08/18 07:19:06 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.974 2011/08/20 14:43:25 cg Exp §'
 !
 
 version_SVN
@@ -7654,3 +7665,4 @@
 
 
 
+