--- a/Class.st Sat Jan 04 20:36:58 1997 +0100
+++ b/Class.st Sat Jan 04 21:09:17 1997 +0100
@@ -2225,25 +2225,28 @@
!Class methodsFor:'fileOut'!
-basicFileOutDefinitionOn:aStream
+basicFileOutDefinitionOn:aStream withNameSpace:forceNameSpace
"append an expression on aStream, which defines myself."
|s owner ns nsName fullName|
owner := self owningClass.
- ns := self nameSpace.
-
- fullName := FileOutNameSpaceQuerySignal raise == true.
owner isNil ifTrue:[
- fullName ifFalse:[
- (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
- nsName := ns name.
- (nsName includes:$:) ifTrue:[
- nsName := '''' , nsName , ''''
- ].
- aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr.
- ]
+ ns := self nameSpace.
+ ] ifFalse:[
+ ns := self topOwningClass nameSpace
+ ].
+ fullName := FileOutNameSpaceQuerySignal raise == true.
+
+ ((owner isNil and:[fullName not])
+ or:[owner notNil and:[forceNameSpace and:[fullName not]]]) ifTrue:[
+ (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
+ nsName := ns name.
+ (nsName includes:$:) ifTrue:[
+ nsName := '''' , nsName , ''''
+ ].
+ aStream nextPutLine:'"{ NameSpace: ' , nsName , ' }"'; cr.
]
].
@@ -2266,8 +2269,13 @@
aStream nextPutAll:s.
aStream space.
self basicFileOutInstvarTypeKeywordOn:aStream.
+
fullName ifTrue:[
- aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''.
+ owner isNil ifTrue:[
+ aStream nextPutAll:'#'''; nextPutAll:(self name); nextPutAll:''''.
+ ] ifFalse:[
+ aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix).
+ ]
] ifFalse:[
aStream nextPut:$#; nextPutAll:(self nameWithoutPrefix).
].
@@ -2306,7 +2314,8 @@
].
aStream cr
- "Modified: 3.1.1997 / 20:43:50 / cg"
+ "Created: 4.1.1997 / 20:38:16 / cg"
+ "Modified: 4.1.1997 / 21:06:42 / cg"
!
basicFileOutInstvarTypeKeywordOn:aStream
@@ -2759,7 +2768,9 @@
fileOutDefinitionOn:aStream
"append an expression on aStream, which defines myself."
- ^ self basicFileOutDefinitionOn:aStream
+ ^ self basicFileOutDefinitionOn:aStream withNameSpace:false
+
+ "Modified: 4.1.1997 / 20:55:18 / cg"
!
fileOutIn:aFileDirectory
@@ -4553,6 +4564,6 @@
!Class class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.233 1997-01-03 20:13:15 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.234 1997-01-04 20:09:17 cg Exp $'
! !
Class initialize!