Login  Register

Re: Traits versus packages

Posted by jfabry on Apr 30, 2010; 4:20pm
URL: https://forum.world.st/Traits-versus-packages-tp2068491p2077152.html


Indeed.  Maybe hook into Monticello to detect that a publish will be done and then do an unload, and after the publish a load. This system is getting to be a bit fiddly, but I see no fundamental solution. That is until the entire package mechanism becomes more powerful in this regard.

On 30 Apr 2010, at 09:06, Tudor Girba wrote:

> Hi,
>
> Let me explain: I have ClassX that is extended to use TraitX. Now, I want to add an instance variable to the main class while the extension is loaded.
>
> You would go to ClassX and edit it:
>
> Object subclass: #ClassX
> uses: TraitX
> instanceVariableNames: 'newInstanceVariable'
> classVariableNames: ''
> poolDictionaries: ''
> category: 'Base-Category'
>
> Now, if you save, the uses: clause will go in the base class. So, if I publish the package that only contains the base class I will have an unwanted side effect: the base version of ClassX will use TraitX.
>
> Cheers,
> Doru
>
>
> On 29 Apr 2010, at 18:01, Johan Fabry wrote:
>
>>
>> Not necessarily ;-) if the browser displays the uses: TraitX (because it was added by the extension) and you add an instance var, you are going to do that with the uses: TraitX because that's what's displayed in the pane where you add the instance vars. Unless you manually remove it because you are a nasty person... and then you are just shooting yourself in the foot anyway. :-)
>>
>> Now on traits unload this has to be done in a clever way, not simply reverting to the state before traits load to avoid losing any other changes made.

--
Johan Fabry  
[hidden email] - http://dcc.uchile.cl/~jfabry
PLEIAD Lab - Computer Science Department (DCC) - University of Chile




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