class: ClassDescription
authorClaus Gittinger <cg@exept.de>
Wed, 05 Feb 2014 18:12:41 +0100
changeset 15946 45304252112b
parent 15945 94b64f8a1abe
child 15947 edce1c1a0ab9
class: ClassDescription added: #addInstVarName:afterIndex: changed: #addInstVarName: merged in jv's changes
ClassDescription.st
--- a/ClassDescription.st	Wed Feb 05 18:11:46 2014 +0100
+++ b/ClassDescription.st	Wed Feb 05 18:12:41 2014 +0100
@@ -697,9 +697,25 @@
 !ClassDescription methodsFor:'Compatibility-ST80'!
 
 addInstVarName:anotherInstVar
-    |sel newClass args newNames|
-
-    newNames := self instanceVariableString , ' ' , anotherInstVar.
+    ^ self addInstVarName:anotherInstVar afterIndex: nil
+
+    "Modified: / 25-02-2009 / 14:51:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 18-01-2011 / 17:57:23 / cg"
+    "Modified: / 31-01-2014 / 02:00:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+addInstVarName:anotherInstVar afterIndex: indexOrNil
+    |newClass newNames|
+
+    indexOrNil notNil ifTrue:[ 
+        | oldNames |
+
+        oldNames := self instVarNames asOrderedCollection.
+        oldNames := oldNames add: anotherInstVar afterIndex: (indexOrNil min: oldNames size).
+        newNames := oldNames asStringWith:' '.  
+    ] ifFalse:[ 
+        newNames := self instanceVariableString , ' ' , anotherInstVar.
+    ].
 
     self isMeta ifTrue:[
         ^ self instanceVariableNames:newNames.
@@ -759,8 +775,8 @@
     ^ newClass
     "
 
-    "Modified: / 25-02-2009 / 14:51:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 18-01-2011 / 17:57:23 / cg"
+    "Created: / 31-01-2014 / 01:51:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 05-02-2014 / 18:12:25 / cg"
 !
 
 organization
@@ -4296,11 +4312,11 @@
 !ClassDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.249 2013-12-12 11:00:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.250 2014-02-05 17:12:41 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.249 2013-12-12 11:00:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.250 2014-02-05 17:12:41 cg Exp $'
 ! !