ClassDescription.st
changeset 5631 d0965449b419
parent 5581 7bef1c75fb06
child 5636 eab6a71fb3d0
--- a/ClassDescription.st	Tue Sep 26 14:40:28 2000 +0200
+++ b/ClassDescription.st	Tue Sep 26 14:41:53 2000 +0200
@@ -562,6 +562,41 @@
 
 !ClassDescription methodsFor:'Compatibility - ST80'!
 
+addInstVarName:anotherInstVar
+    |sel newClass args|
+
+    sel := self definitionSelector.
+    Class nameSpaceQuerySignal answer:(self nameSpace)
+    do:[
+        args := Array 
+                    with:(self name)
+                    with:(self instanceVariableString , ' ' , anotherInstVar)
+                    with:(self classVariableString)
+                    with:''
+                    with:(self category).
+
+        sel numArgs == 6 ifTrue:[
+            args := args copyWith:(self owner).
+        ].
+
+        newClass := self superclass
+            perform:sel withArguments:args.
+
+"/        "/ copy over methods ...
+"/        self class copyInvalidatedMethodsFrom:self class for:newClass class.
+"/        self class copyInvalidatedMethodsFrom:self for:newClass.
+"/        newClass class recompileInvalidatedMethods.
+"/        newClass recompileInvalidatedMethods.
+    ].
+
+"/    owner changed:#newClass with:newClass.
+"/    Smalltalk changed:#newClass with:newClass.
+
+"/    self removeFromSystem.
+
+    ^ newClass
+!
+
 organization
     "for ST80 compatibility; 
      read the documentation in ClassOrganizer for more info."
@@ -569,6 +604,44 @@
     ^ ClassOrganizer for:self
 !
 
+removeInstVarName:anInstVar
+    |sel newClass args newNames|
+
+    newNames := self instVarNames.
+    newNames remove:anInstVar ifAbsent:[^ self].
+
+    sel := self definitionSelector.
+    Class nameSpaceQuerySignal answer:(self nameSpace)
+    do:[
+        args := Array 
+                    with:(self name)
+                    with:(newNames asStringWith:Character space)
+                    with:(self classVariableString)
+                    with:''
+                    with:(self category).
+
+        sel numArgs == 6 ifTrue:[
+            args := args copyWith:(self owner).
+        ].
+
+        newClass := self superclass
+            perform:sel withArguments:args.
+
+"/        "/ copy over methods ...
+"/        self class copyInvalidatedMethodsFrom:self class for:newClass class.
+"/        self class copyInvalidatedMethodsFrom:self for:newClass.
+"/        newClass class recompileInvalidatedMethods.
+"/        newClass recompileInvalidatedMethods.
+    ].
+
+"/    owner changed:#newClass with:newClass.
+"/    Smalltalk changed:#newClass with:newClass.
+
+"/    self removeFromSystem.
+
+    ^ newClass
+!
+
 reorganizeFromString:orgString
     "for ST80 compatibility but without functionality"
 
@@ -3716,6 +3789,6 @@
 !ClassDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.108 2000-09-03 14:45:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.109 2000-09-26 12:41:53 cg Exp $'
 ! !
 ClassDescription initialize!