Class.st
changeset 1923 97b099fef985
parent 1919 cb189a5dcac8
child 1924 0103d478f8a4
--- a/Class.st	Thu Nov 07 17:36:30 1996 +0100
+++ b/Class.st	Thu Nov 07 18:56:32 1996 +0100
@@ -16,7 +16,7 @@
 		CatchMethodRedefinitions MethodRedefinitionSignal
 		UpdateChangeFileQuerySignal TryLocalSourceFirst
 		ChangeFileAccessLock NameSpaceQuerySignal PackageQuerySignal
-		CreateNameSpaceQuerySignal'
+		CreateNameSpaceQuerySignal OldMethods'
 	poolDictionaries:''
 	category:'Kernel-Classes'
 !
@@ -73,11 +73,6 @@
                                         (except during startup and when filing in, this flag
                                          is usually true)
 
-        LockChangesFile <Boolean>       if true, the change file is locked for updates.
-                                        Required when multiple users operate on a common
-                                        change file.
-                                        This is an experimental new feature, being evaluated.
-
         UpdateChangeFileQuerySignal     used as an upQuery from the change management.
                                         Whenever a changeRecord is to be written,
                                         this signal is raised and a handler (if present)
@@ -88,6 +83,11 @@
                                         mechanism is used if no query-handler
                                         is present).
 
+        LockChangesFile <Boolean>       if true, the change file is locked for updates.
+                                        Required when multiple users operate on a common
+                                        change file.
+                                        This is an experimental new feature, being evaluated.
+
         FileOutErrorSignal              raised when an error occurs during fileOut
 
         CatchMethodRedefinitions        if true, classes protect themself 
@@ -107,7 +107,21 @@
                                         Should be turned on, if you run an image from
                                         local sources which have not yet been checked in.
 
-                                        
+        NameSpaceQuerySignal            used as an upQuery to ask for a namespace into
+                                        which new classes are to be installed.
+
+        PackageQuerySignal              used as an upQuery to ask for a packageSymbol with
+                                        which new classes/methods are to be marked.
+
+        CreateNameSpaceQuerySignal      used as an upQuery to ask if unknown namespaces
+                                        should be silently created (without asking the user)
+
+        OldMethods                      if nonNil, this must be an IdentityDictionary,
+                                        which is filled with method->previousversionMethod
+                                        associations. Can be used for undo-last-method-change
+                                        Notice: this may fillup your memory over time.
+
+
     WARNING: layout known by compiler and runtime system
 
     [author:]
@@ -259,6 +273,26 @@
     ^ prev
 !
 
+keepOldMethods:aBoolean
+    "turn on/off oldMethod remembering. If on, a methods previous version
+     is kept locally, for later undo (or compare)."
+
+    aBoolean ifTrue:[
+        OldMethods isNil ifTrue:[
+            OldMethods := IdentityDictionary new.
+        ]
+    ] ifFalse:[
+        OldMethods := nil
+    ].
+
+    "
+     Class keepOldMethods:true
+     Class keepOldMethods:false
+    "
+
+    "Modified: 7.11.1996 / 18:36:00 / cg"
+!
+
 lockChangesFile
     "return true, if the change file is locked during update"
 
@@ -275,6 +309,20 @@
     ^ prev
 !
 
+oldMethods
+    "return a dictionary containing method->previousVersion associations,
+     nil if method remembering has been turned off"
+
+    ^ OldMethods 
+
+    "
+     Class oldMethods
+    "
+
+    "Modified: 7.11.1996 / 18:36:00 / cg"
+    "Created: 7.11.1996 / 18:40:12 / cg"
+!
+
 tryLocalSourceFirst
     ^ TryLocalSourceFirst
 
@@ -1065,12 +1113,33 @@
             ]
         ]
     ].
+
+    OldMethods notNil ifTrue:[
+        oldMethod := self compiledMethodAt:newSelector.
+        oldMethod notNil ifTrue:[
+"/            oldMethod source:(oldMethod source).
+            OldMethods at:newMethod put:oldMethod
+        ]
+    ].
+
     (super addSelector:newSelector withMethod:newMethod) ifTrue:[
         self addChangeRecordForMethod:newMethod.
     ]
 
     "Created: 29.10.1995 / 19:42:42 / cg"
     "Modified: 9.9.1996 / 22:39:32 / stefan"
+    "Modified: 7.11.1996 / 18:49:43 / cg"
+!
+
+basicAddSelector:newSelector withMethod:newMethod
+    "add the method given by 2nd argument under the selector given by
+     1st argument to the methodDictionary. 
+     This does NOT append a change record to the changes file and tell 
+     dependents. Also, no methodHistory is kept or redefinition is checked."
+
+    super addSelector:newSelector withMethod:newMethod
+
+    "Created: 7.11.1996 / 18:48:35 / cg"
 !
 
 removeSelector:aSelector
@@ -4364,6 +4433,6 @@
 !Class class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.207 1996-11-07 12:51:20 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Class.st,v 1.208 1996-11-07 17:55:39 cg Exp $'
 ! !
 Class initialize!