In Latest OB I cannot add a class variable

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

In Latest OB I cannot add a class variable

Mariano Martinez Peck
Hi Lukas. I am using latest OB + RB in PharoDev 1.1 and I have a problem trying to add a class variable.

To reprpoduce
1) take any class, for example TestCase.
2) Go to the class side
3) add a class side variable. For example:

TestCase class
    instanceVariableNames: 'history something'

4) The problem is in

 InteractiveAddClassChange >> definingSuperclass
    ^ Smalltalk globals at: self superclassName


since self superclassName answers nil, because


AddClassChange class >> superclassName
    className isNil
        ifTrue: [ self fillOutDefinition ].
    ^ superclassName

className prints ->  #'Unknown Class'

I attach PharoDebug.log also.

Cheers

Mariano

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

PharoDebug.log (38K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
Strange, I'll look into it later today.

Lukas

On Thursday, September 30, 2010, Mariano Martinez Peck
<[hidden email]> wrote:

> Hi Lukas. I am using latest OB + RB in PharoDev 1.1 and I have a problem trying to add a class variable.
>
> To reprpoduce
> 1) take any class, for example TestCase.
> 2) Go to the class side
> 3) add a class side variable. For example:
>
> TestCase class
>     instanceVariableNames: 'history something'
>
> 4) The problem is in
>
>  InteractiveAddClassChange >> definingSuperclass
>     ^ Smalltalk globals at: self superclassName
>
>
> since self superclassName answers nil, because
>
>
> AddClassChange class >> superclassName
>     className isNil
>         ifTrue: [ self fillOutDefinition ].
>     ^ superclassName
>
> className prints ->  #'Unknown Class'
>
> I attach PharoDebug.log also.
>
> Cheers
>
> Mariano
>

--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
The latest OB and Refactory code should fix this and a couple of related issues.

Lukas

On 30 September 2010 12:11, Lukas Renggli <[hidden email]> wrote:

> Strange, I'll look into it later today.
>
> Lukas
>
> On Thursday, September 30, 2010, Mariano Martinez Peck
> <[hidden email]> wrote:
>> Hi Lukas. I am using latest OB + RB in PharoDev 1.1 and I have a problem trying to add a class variable.
>>
>> To reprpoduce
>> 1) take any class, for example TestCase.
>> 2) Go to the class side
>> 3) add a class side variable. For example:
>>
>> TestCase class
>>     instanceVariableNames: 'history something'
>>
>> 4) The problem is in
>>
>>  InteractiveAddClassChange >> definingSuperclass
>>     ^ Smalltalk globals at: self superclassName
>>
>>
>> since self superclassName answers nil, because
>>
>>
>> AddClassChange class >> superclassName
>>     className isNil
>>         ifTrue: [ self fillOutDefinition ].
>>     ^ superclassName
>>
>> className prints ->  #'Unknown Class'
>>
>> I attach PharoDebug.log also.
>>
>> Cheers
>>
>> Mariano
>>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Mariano Martinez Peck
Thanks Lukas. It is working now.

Cheers

Mariano

On Thu, Sep 30, 2010 at 8:44 PM, Lukas Renggli <[hidden email]> wrote:
The latest OB and Refactory code should fix this and a couple of related issues.

Lukas

On 30 September 2010 12:11, Lukas Renggli <[hidden email]> wrote:
> Strange, I'll look into it later today.
>
> Lukas
>
> On Thursday, September 30, 2010, Mariano Martinez Peck
> <[hidden email]> wrote:
>> Hi Lukas. I am using latest OB + RB in PharoDev 1.1 and I have a problem trying to add a class variable.
>>
>> To reprpoduce
>> 1) take any class, for example TestCase.
>> 2) Go to the class side
>> 3) add a class side variable. For example:
>>
>> TestCase class
>>     instanceVariableNames: 'history something'
>>
>> 4) The problem is in
>>
>>  InteractiveAddClassChange >> definingSuperclass
>>     ^ Smalltalk globals at: self superclassName
>>
>>
>> since self superclassName answers nil, because
>>
>>
>> AddClassChange class >> superclassName
>>     className isNil
>>         ifTrue: [ self fillOutDefinition ].
>>     ^ superclassName
>>
>> className prints ->  #'Unknown Class'
>>
>> I attach PharoDebug.log also.
>>
>> Cheers
>>
>> Mariano
>>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Mariano Martinez Peck
Lukas, now I have another problem. I am not sure if it is OB latest code related, but I think so.

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


and then RBSemanticTest is not changed at all.

Thanks!

Mariano


On Thu, Sep 30, 2010 at 9:46 PM, Mariano Martinez Peck <[hidden email]> wrote:
Thanks Lukas. It is working now.

Cheers

Mariano


On Thu, Sep 30, 2010 at 8:44 PM, Lukas Renggli <[hidden email]> wrote:
The latest OB and Refactory code should fix this and a couple of related issues.

Lukas

On 30 September 2010 12:11, Lukas Renggli <[hidden email]> wrote:
> Strange, I'll look into it later today.
>
> Lukas
>
> On Thursday, September 30, 2010, Mariano Martinez Peck
> <[hidden email]> wrote:
>> Hi Lukas. I am using latest OB + RB in PharoDev 1.1 and I have a problem trying to add a class variable.
>>
>> To reprpoduce
>> 1) take any class, for example TestCase.
>> 2) Go to the class side
>> 3) add a class side variable. For example:
>>
>> TestCase class
>>     instanceVariableNames: 'history something'
>>
>> 4) The problem is in
>>
>>  InteractiveAddClassChange >> definingSuperclass
>>     ^ Smalltalk globals at: self superclassName
>>
>>
>> since self superclassName answers nil, because
>>
>>
>> AddClassChange class >> superclassName
>>     className isNil
>>         ifTrue: [ self fillOutDefinition ].
>>     ^ superclassName
>>
>> className prints ->  #'Unknown Class'
>>
>> I attach PharoDebug.log also.
>>
>> Cheers
>>
>> Mariano
>>
>
> --
> Lukas Renggli
> www.lukas-renggli.ch
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project



_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
> 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

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
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 <[hidden email]> 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
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Mariano Martinez Peck


On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <[hidden email]> 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 <[hidden email]> 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
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
It works for me, are you sure to use the latest code?

2010/10/2 Mariano Martinez Peck <[hidden email]>:

>
>
> On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <[hidden email]> 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 <[hidden email]> 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
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Mariano Martinez Peck


On Sat, Oct 2, 2010 at 8:02 PM, Lukas Renggli <[hidden email]> wrote:
It works for me, are you sure to use the latest code?

yep.

I tried to evaluate:

ProtoObject subclass: #RBSemanticTest
    instanceVariableNames: 'instVar'
    classVariableNames: 'ClassVar'
    poolDictionaries: ''
    category: 'AST-Tests-Semantic'


and got an error in

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

since self superclassName answers:

 a Text for 'ProtoObject subclass: #RBSemanticTest
    instanceVariableNames: ''instVar''
    classVariableNames: ''ClassVar''
    poolDictionaries: ''''
    category: ''AST-Tests-Semantic'''
 

weird....

thanks

mariano


2010/10/2 Mariano Martinez Peck <[hidden email]>:
>
>
> On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <[hidden email]> 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 <[hidden email]> 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
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Lukas Renggli
This works for me.

'superclassName' is the superclass name, but contains the definition
which should be in the variable 'definition'.

Looks like you need to recompile your image, the instance variable
indexes seem to be messed up.

Another bug I noticed in the ClassBuilder is that existing instances
cannot be migrated if the old or the new class are subclasses of nil
or ProtoObject, because #instVarAt: is then missing.

Lukas

2010/10/2 Mariano Martinez Peck <[hidden email]>:

>
>
> On Sat, Oct 2, 2010 at 8:02 PM, Lukas Renggli <[hidden email]> wrote:
>>
>> It works for me, are you sure to use the latest code?
>
> yep.
>
> I tried to evaluate:
>
> ProtoObject subclass: #RBSemanticTest
>     instanceVariableNames: 'instVar'
>     classVariableNames: 'ClassVar'
>     poolDictionaries: ''
>     category: 'AST-Tests-Semantic'
>
>
> and got an error in
>
>  AddClassChange >> definitionClass
>     ^ Smalltalk globals at: (self superclassName ifNil: [ ^ ProtoObject ])
>
> since self superclassName answers:
>
>  a Text for 'ProtoObject subclass: #RBSemanticTest
>     instanceVariableNames: ''instVar''
>     classVariableNames: ''ClassVar''
>     poolDictionaries: ''''
>     category: ''AST-Tests-Semantic'''
>
>
> weird....
>
> thanks
>
> mariano
>
>>
>> 2010/10/2 Mariano Martinez Peck <[hidden email]>:
>> >
>> >
>> > On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <[hidden email]> 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 <[hidden email]> 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
>> >> [hidden email]
>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: In Latest OB I cannot add a class variable

Mariano Martinez Peck


On Sun, Oct 3, 2010 at 9:31 AM, Lukas Renggli <[hidden email]> wrote:
This works for me.

'superclassName' is the superclass name, but contains the definition
which should be in the variable 'definition'.

Looks like you need to recompile your image, the instance variable
indexes seem to be messed up.

Thanks Lukas, indeed, evaluating a Compiler recompileAll was the trick to make it work.
 

Another bug I noticed in the ClassBuilder is that existing instances
cannot be migrated if the old or the new class are subclasses of nil
or ProtoObject, because #instVarAt: is then missing.

Yes, I saw this also. I had some proxies that extended from ProtoObject, then I wanted them to extend from Object...

thanks!

mariano
 

Lukas

2010/10/2 Mariano Martinez Peck <[hidden email]>:
>
>
> On Sat, Oct 2, 2010 at 8:02 PM, Lukas Renggli <[hidden email]> wrote:
>>
>> It works for me, are you sure to use the latest code?
>
> yep.
>
> I tried to evaluate:
>
> ProtoObject subclass: #RBSemanticTest
>     instanceVariableNames: 'instVar'
>     classVariableNames: 'ClassVar'
>     poolDictionaries: ''
>     category: 'AST-Tests-Semantic'
>
>
> and got an error in
>
>  AddClassChange >> definitionClass
>     ^ Smalltalk globals at: (self superclassName ifNil: [ ^ ProtoObject ])
>
> since self superclassName answers:
>
>  a Text for 'ProtoObject subclass: #RBSemanticTest
>     instanceVariableNames: ''instVar''
>     classVariableNames: ''ClassVar''
>     poolDictionaries: ''''
>     category: ''AST-Tests-Semantic'''
>
>
> weird....
>
> thanks
>
> mariano
>
>>
>> 2010/10/2 Mariano Martinez Peck <[hidden email]>:
>> >
>> >
>> > On Sat, Oct 2, 2010 at 1:54 PM, Lukas Renggli <[hidden email]> 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 <[hidden email]> 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
>> >> [hidden email]
>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [hidden email]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>>
>>
>> --
>> Lukas Renggli
>> www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Lukas Renggli
www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project