changeFile updates must use the classes full name.
authorClaus Gittinger <cg@exept.de>
Fri, 03 Jan 1997 13:31:06 +0100
changeset 2036 bedc0bb03129
parent 2035 5b79c170d6a3
child 2037 d5644b390755
changeFile updates must use the classes full name.
Class.st
--- a/Class.st	Fri Jan 03 13:28:31 1997 +0100
+++ b/Class.st	Fri Jan 03 13:31:06 1997 +0100
@@ -16,7 +16,8 @@
 		CatchMethodRedefinitions MethodRedefinitionSignal
 		UpdateChangeFileQuerySignal TryLocalSourceFirst
 		ChangeFileAccessLock NameSpaceQuerySignal PackageQuerySignal
-		UsedNameSpaceQuerySignal CreateNameSpaceQuerySignal OldMethods'
+		UsedNameSpaceQuerySignal CreateNameSpaceQuerySignal OldMethods
+		FileOutNameSpaceQuerySignal'
 	poolDictionaries:''
 	category:'Kernel-Classes'
 !
@@ -184,10 +185,13 @@
                                                                         Project currentPackageName
                                                                     ])].
 
+        FileOutNameSpaceQuerySignal := QuerySignal new.
+        FileOutNameSpaceQuerySignal handlerBlock:[:ex | ex proceedWith:false].
+
         ChangeFileAccessLock := Semaphore forMutualExclusion.
     ]
 
-    "Modified: 30.12.1996 / 18:09:19 / cg"
+    "Modified: 3.1.1997 / 13:21:20 / cg"
 ! !
 
 !Class class methodsFor:'Signal constants'!
@@ -1159,6 +1163,15 @@
     "Created: 7.11.1996 / 18:48:35 / cg"
 !
 
+removeFromSystem
+    "ST-80 compatibility
+     remove myself from the system"
+
+    ^ Smalltalk removeClass:self
+
+    "Created: 6.2.1996 / 11:32:58 / stefan"
+!
+
 removeSelector:aSelector
     "remove the selector, aSelector and its associated method 
      from the methodDictionary.
@@ -3071,15 +3084,19 @@
 
 printClassNameOn:aStream
     "helper for fileOut - print my name if I am not a Metaclass;
-     otherwise my name without -class followed by space-class"
+     otherwise my name without -class followed by space-class.
+     Private classes always print their owning-class as nameSpace
+     prefix; non-private ones print without, except if the
+     FileOutNameSpaceQuery returns true. The last feature is used
+     with changefile updates - here, the full name is wanted."
 
     |nm|
 
-"/    nm := self name.
+    nm := self name.
     self owningClass isNil ifTrue:[
-        nm := self nameWithoutPrefix
-    ] ifFalse:[
-        nm := self name
+        FileOutNameSpaceQuerySignal raise == false ifTrue:[
+            nm := self nameWithoutPrefix
+        ]
     ].
     self isMeta ifTrue:[
         (nm endsWith:' class') ifTrue:[
@@ -3092,7 +3109,7 @@
         nm printOn:aStream
     ]
 
-    "Modified: 21.12.1996 / 13:28:42 / cg"
+    "Modified: 3.1.1997 / 13:30:19 / cg"
 !
 
 printClassVarNamesOn:aStream indent:indent
@@ -3567,22 +3584,28 @@
     ChangeFileAccessLock critical:[
         |aStream|
 
-        aStream := self changesStream.
-        aStream notNil ifTrue:[
-            FileStream writeErrorSignal handle:[:ex |
-                self warn:('could not update the changes-file\\' , ex errorString) withCRs.
-                ex return
-            ] do:[
-                doStampIt ifTrue:[self addChangeTimeStampTo:aStream].
-                aBlock value:aStream.
-                aStream cr.
-            ].
-            aStream close
+        FileOutNameSpaceQuerySignal answer:true
+        do:[
+            aStream := self changesStream.
+            aStream notNil ifTrue:[
+                [
+                    FileStream writeErrorSignal handle:[:ex |
+                        self warn:('could not update the changes-file\\' , ex errorString) withCRs.
+                        ex return
+                    ] do:[
+                        doStampIt ifTrue:[self addChangeTimeStampTo:aStream].
+                        aBlock value:aStream.
+                        aStream cr.
+                    ].
+                ] valueNowOrOnUnwindDo:[
+                    aStream close
+                ]
+            ]
         ]
     ]
 
     "Created: 18.11.1995 / 15:36:02 / cg"
-    "Modified: 21.3.1996 / 16:32:30 / cg"
+    "Modified: 3.1.1997 / 13:23:04 / cg"
 !
 
 writingChangeWithTimeStamp:stampIt perform:aSelector with:anArgument
@@ -4501,6 +4524,6 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.228 1997-01-02 13:10:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.229 1997-01-03 12:31:06 cg Exp $'
 ! !
 Class initialize!