ClassDescription.st
changeset 5631 d0965449b419
parent 5581 7bef1c75fb06
child 5636 eab6a71fb3d0
equal deleted inserted replaced
5630:6198ad1b731b 5631:d0965449b419
   560 
   560 
   561 ! !
   561 ! !
   562 
   562 
   563 !ClassDescription methodsFor:'Compatibility - ST80'!
   563 !ClassDescription methodsFor:'Compatibility - ST80'!
   564 
   564 
       
   565 addInstVarName:anotherInstVar
       
   566     |sel newClass args|
       
   567 
       
   568     sel := self definitionSelector.
       
   569     Class nameSpaceQuerySignal answer:(self nameSpace)
       
   570     do:[
       
   571         args := Array 
       
   572                     with:(self name)
       
   573                     with:(self instanceVariableString , ' ' , anotherInstVar)
       
   574                     with:(self classVariableString)
       
   575                     with:''
       
   576                     with:(self category).
       
   577 
       
   578         sel numArgs == 6 ifTrue:[
       
   579             args := args copyWith:(self owner).
       
   580         ].
       
   581 
       
   582         newClass := self superclass
       
   583             perform:sel withArguments:args.
       
   584 
       
   585 "/        "/ copy over methods ...
       
   586 "/        self class copyInvalidatedMethodsFrom:self class for:newClass class.
       
   587 "/        self class copyInvalidatedMethodsFrom:self for:newClass.
       
   588 "/        newClass class recompileInvalidatedMethods.
       
   589 "/        newClass recompileInvalidatedMethods.
       
   590     ].
       
   591 
       
   592 "/    owner changed:#newClass with:newClass.
       
   593 "/    Smalltalk changed:#newClass with:newClass.
       
   594 
       
   595 "/    self removeFromSystem.
       
   596 
       
   597     ^ newClass
       
   598 !
       
   599 
   565 organization
   600 organization
   566     "for ST80 compatibility; 
   601     "for ST80 compatibility; 
   567      read the documentation in ClassOrganizer for more info."
   602      read the documentation in ClassOrganizer for more info."
   568 
   603 
   569     ^ ClassOrganizer for:self
   604     ^ ClassOrganizer for:self
       
   605 !
       
   606 
       
   607 removeInstVarName:anInstVar
       
   608     |sel newClass args newNames|
       
   609 
       
   610     newNames := self instVarNames.
       
   611     newNames remove:anInstVar ifAbsent:[^ self].
       
   612 
       
   613     sel := self definitionSelector.
       
   614     Class nameSpaceQuerySignal answer:(self nameSpace)
       
   615     do:[
       
   616         args := Array 
       
   617                     with:(self name)
       
   618                     with:(newNames asStringWith:Character space)
       
   619                     with:(self classVariableString)
       
   620                     with:''
       
   621                     with:(self category).
       
   622 
       
   623         sel numArgs == 6 ifTrue:[
       
   624             args := args copyWith:(self owner).
       
   625         ].
       
   626 
       
   627         newClass := self superclass
       
   628             perform:sel withArguments:args.
       
   629 
       
   630 "/        "/ copy over methods ...
       
   631 "/        self class copyInvalidatedMethodsFrom:self class for:newClass class.
       
   632 "/        self class copyInvalidatedMethodsFrom:self for:newClass.
       
   633 "/        newClass class recompileInvalidatedMethods.
       
   634 "/        newClass recompileInvalidatedMethods.
       
   635     ].
       
   636 
       
   637 "/    owner changed:#newClass with:newClass.
       
   638 "/    Smalltalk changed:#newClass with:newClass.
       
   639 
       
   640 "/    self removeFromSystem.
       
   641 
       
   642     ^ newClass
   570 !
   643 !
   571 
   644 
   572 reorganizeFromString:orgString
   645 reorganizeFromString:orgString
   573     "for ST80 compatibility but without functionality"
   646     "for ST80 compatibility but without functionality"
   574 
   647 
  3714 ! !
  3787 ! !
  3715 
  3788 
  3716 !ClassDescription class methodsFor:'documentation'!
  3789 !ClassDescription class methodsFor:'documentation'!
  3717 
  3790 
  3718 version
  3791 version
  3719     ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.108 2000-09-03 14:45:01 cg Exp $'
  3792     ^ '$Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.109 2000-09-26 12:41:53 cg Exp $'
  3720 ! !
  3793 ! !
  3721 ClassDescription initialize!
  3794 ClassDescription initialize!