Login  Register

Re: Traits versus packages

Posted by Tudor Girba on Apr 29, 2010; 7:07am
URL: https://forum.world.st/Traits-versus-packages-tp2068491p2075076.html

It also should be noted that it is completely obscure when trying to  
understand a piece of code :)

Cheers,
Doru


On 28 Apr 2010, at 20:03, Alexandre Bergel wrote:

>> Or can we make a traits installer, that performs the redefinition  
>> of target classes? First check if the target classes already  
>> declare a uses:, and if not add it. Sounds like simple  
>> metaprogramming ...
>>
>> Any comments on this 'solution'?
>
> Although not perfect, it is easy and efficient.
>
> Alexandre
>
>>
>> On 28 Apr 2010, at 01:56, Stéphane Ducasse wrote:
>>
>>> so far (and similarly to instance variable) you cannot with the  
>>> current definition syntax
>>> declare a trait (add instance) to a class from a package that does  
>>> not define the class.
>>> You can do that in the initialize of a class loaded in a package  
>>> but there is no think like
>>>
>>> MyClass addInstanceVariable: 'x'
>>> MyOtherClass addTrait:
>>>
>>> at the similar syntax level than
>>>
>>>> FAMIXScopingEntity subclass: #FAMIXNamespace
>>>> uses: TAMStructuralZoom
>>>> instanceVariableNames: ''
>>>> classVariableNames: ''
>>>> poolDictionaries: ''
>>>> category: 'Famix-Core'
>>>
>>> this is why one day packages will have to be a bit better  
>>> supported and more important
>>> we will have  fix the "semantics" of changeset to be something  
>>> than a simple side effect of 'oh this is easy' just save the class  
>>> def and the method definition (because a class is a complex object).
>>
>> --
>> 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
>
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users

--
www.tudorgirba.com

"If you interrupt the barber while he is cutting your hair,
you will end up with a messy haircut."


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