[Pharo-project] In Latest OB I cannot add a class variable

Lukas Renggli renggli at gmail.com
Sat Oct 2 07:54:24 EDT 2010


Ok, I fixed that. The refactoring engine now supports all the 24 (!!!)
distinct patterns of defining a subclass/trait in Pharo (see below).

  Name: Refactoring-Changes-lr.15
  Author: lr
  Time: 2 October 2010, 1:50:13 pm
  UUID: 82093dfb-e7f2-4ff7-afe7-ac7196632196
  Ancestors: Refactoring-Changes-lr.14

  - also support subclasses of nil

The undo operation of the respective actions should work as well. The
exception here is an asymmetry (bug?) in the Pharo class definition
strings that causes classes without traits to be printed without the
#uses: claus. Evaluating this definition string does not remove the
trait composition if the class happens to have one though.

Lukas

#('`className class instanceVariableNames: `#instanceVariableNames'
'`className class uses: `@traitComposition instanceVariableNames:
`#instanceVariableNames' '`@superclass subclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject subclass: `#className instanceVariableNames:
`#instanceVariableNames classVariableNames: `#classVariableNames
poolDictionaries: `#poolDictionaries category: `#category. `className
superclass: `@superclass' '`@superclass subclass: `#className uses:
`@traitComposition instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category' 'ProtoObject subclass:
`#className uses: `@traitComposition instanceVariableNames:
`#instanceVariableNames classVariableNames: `#classVariableNames
poolDictionaries: `#poolDictionaries category: `#category. `className
superclass: `@superclass' '`@superclass variableByteSubclass:
`#className instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category' 'ProtoObject
variableByteSubclass: `#className instanceVariableNames:
`#instanceVariableNames classVariableNames: `#classVariableNames
poolDictionaries: `#poolDictionaries category: `#category. `className
superclass: `@superclass' '`@superclass variableByteSubclass:
`#className uses: `@traitComposition instanceVariableNames:
`#instanceVariableNames classVariableNames: `#classVariableNames
poolDictionaries: `#poolDictionaries category: `#category'
'ProtoObject variableByteSubclass: `#className uses:
`@traitComposition instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category. `className superclass:
`@superclass' '`@superclass variableSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject variableSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category. `className superclass: `@superclass' '`@superclass
variableSubclass: `#className uses: `@traitComposition
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject variableSubclass: `#className uses:
`@traitComposition instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category. `className superclass:
`@superclass' '`@superclass variableWordSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject variableWordSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category. `className superclass: `@superclass' '`@superclass
variableWordSubclass: `#className uses: `@traitComposition
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject variableWordSubclass: `#className uses:
`@traitComposition instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category. `className superclass:
`@superclass' '`@superclass weakSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject weakSubclass: `#className
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category. `className superclass: `@superclass' '`@superclass
weakSubclass: `#className uses: `@traitComposition
instanceVariableNames: `#instanceVariableNames classVariableNames:
`#classVariableNames poolDictionaries: `#poolDictionaries category:
`#category' 'ProtoObject weakSubclass: `#className uses:
`@traitComposition instanceVariableNames: `#instanceVariableNames
classVariableNames: `#classVariableNames poolDictionaries:
`#poolDictionaries category: `#category. `className superclass:
`@superclass' '`traitName classTrait uses: `@traitComposition' 'Trait
named: `#traitName uses: `@traitComposition category: `#category')

On 2 October 2010 13:01, Lukas Renggli <renggli at gmail.com> wrote:
>> Lukas, now I have another problem. I am not sure if it is OB latest code
>> related, but I think so.
>
> No, that was always the case.
>
>> If you take any class, suppose RBSemanticTest and go to its definition.
>> Change it so that it extends from ProtoObject instead of TestCase. When you
>> accept the code (save it), the browser goes directly to Browse ProtoObject,
>> actually to :
>>
>> ProtoObject subclass: #ProtoObject
>>     instanceVariableNames: ''
>>     classVariableNames: ''
>>     poolDictionaries: ''
>>     category: 'Kernel-Objects'.
>> ProtoObject superclass: nil
>
> Creating a subclass like this was never supported by the refactoring engine.
>
> You have to write it like:
>
> nil subclass: #ProtoObject
>      instanceVariableNames: ''
>      classVariableNames: ''
>      poolDictionaries: ''
>      category: 'Kernel-Objects'
>
> Lukas
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>



-- 
Lukas Renggli
www.lukas-renggli.ch




More information about the Pharo-dev mailing list