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

Mariano Martinez Peck marianopeck at gmail.com
Sat Oct 2 13:15:52 EDT 2010


On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <renggli at gmail.com> wrote:

> 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
>
>
Hi Lukas. I tried with nil and it works. However, putting ProtoObject, it
didn't, since

definitionClass
    ^ Smalltalk globals at: (self superclassName ifNil: [ ^ ProtoObject ])

self superclassName   answers

 a Text for 'ProtoObject variableSubclass: #MessageCatchingProxy
    instanceVariableNames: ''''
    classVariableNames: ''''
    poolDictionaries: ''''
    category: ''Proxies'''

Cheers

Mariano



> 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
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101002/6da98b62/attachment-0001.html>


More information about the Pharo-dev mailing list