NameSpace.st
changeset 3383 7837c591ecdb
parent 2924 398bec06170f
child 4058 58987b73c0c7
--- a/NameSpace.st	Mon Apr 20 13:17:00 1998 +0200
+++ b/NameSpace.st	Mon Apr 20 23:34:41 1998 +0200
@@ -140,7 +140,7 @@
      Notice, that the nameSpace is created in the current one -
      dont get confused; we recommend, not to nest them too much."
 
-    |currentNameSpace newNamespace existing ok|
+    |currentNameSpace newNamespace existing ok nameSym|
 
     ok := aStringOrSymbol first isLetter.
     ok ifTrue:[
@@ -164,11 +164,14 @@
     ].
 
     currentNameSpace := Class nameSpaceQuerySignal raise.
-    (existing := currentNameSpace at:aStringOrSymbol asSymbol) notNil ifTrue:[
+    currentNameSpace isNil ifTrue:[currentNameSpace := Smalltalk].
+
+    nameSym := aStringOrSymbol asSymbol.
+    (existing := currentNameSpace at:nameSym) notNil ifTrue:[
         ^ existing
     ].
 
-    newNamespace := self subclass:aStringOrSymbol asSymbol
+    newNamespace := self subclass:nameSym
                          instanceVariableNames:''
                          classVariableNames:''
                          poolDictionaries:''
@@ -331,5 +334,5 @@
 !Namespace class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/NameSpace.st,v 1.25 1997-09-15 20:41:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/NameSpace.st,v 1.26 1998-04-20 21:34:41 cg Exp $'
 ! !