NameSpace.st
branchjv
changeset 17787 c56ba6d58661
parent 17786 e7f6aea89c56
child 17807 06cc6c49e291
--- a/NameSpace.st	Wed Jul 21 16:52:22 2010 +0100
+++ b/NameSpace.st	Wed Jul 21 19:58:43 2010 +0100
@@ -13,18 +13,11 @@
 
 Object subclass:#NameSpace
 	instanceVariableNames:'category'
-	classVariableNames:''
+	classVariableNames:'Imports'
 	poolDictionaries:''
 	category:'Kernel-Classes'
 !
 
-NameSpace class instanceVariableNames:'imports'
-
-"
- No other class instance variables are inherited by this class.
-"
-!
-
 !NameSpace class methodsFor:'documentation'!
 
 copyright
@@ -382,14 +375,15 @@
         ifFalse:[self error: 'Not a namespace or prog. language'].
 
     (self imports includes: aNameSpace) ifFalse:
-        [imports := self imports copyWith: aNameSpace]
+        [self setImports: (self imports copyWith: aNameSpace)]
 
     "Created: / 21-07-2010 / 15:16:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 21-07-2010 / 17:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 imports
-    ^ imports ? #()
+    Imports ifNil:[^#()].
+    ^Imports at: self ifAbsent:[#()].
 
     "Created: / 19-05-2010 / 16:06:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 21-07-2010 / 17:17:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -604,7 +598,8 @@
     "Sets namespace imports. Private entry, 
      Use 'self import: theNamespace' instead"
 
-    imports := anArrayOrNil
+    Imports ifNil:[Imports := IdentityDictionary new].
+	Imports at: self put: (anArrayOrNil ? #()).
 
     "Created: / 21-07-2010 / 15:29:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
@@ -710,7 +705,7 @@
 !NameSpace class methodsFor:'documentation'!
 
 version
-    ^ '$Id: NameSpace.st 10551 2010-07-21 15:52:22Z vranyj1 $'
+    ^ '$Id: NameSpace.st 10552 2010-07-21 18:58:43Z vranyj1 $'
 !
 
 version_CVS
@@ -718,5 +713,5 @@
 !
 
 version_SVN
-    ^ '$Id: NameSpace.st 10551 2010-07-21 15:52:22Z vranyj1 $'
+    ^ '$Id: NameSpace.st 10552 2010-07-21 18:58:43Z vranyj1 $'
 ! !