Ok I slept and now my brain is working.
I think that  having classTrait and trait together is important because else it 
would be the mess when
you have a class method that uses an instance methods (both define in a trait).
So conceptually this is one trait like in smalltalk you have one class and its 
metaclass.

The model is similar and to represent class trait we have a ClassTrait class.

Stef


On Jun 30, 2013, at 1:04 AM, Camillo Bruni <camillobr...@gmail.com> wrote:

> so let's discuss that on monday with the trait specialists Damien et 
> Sebastian :)
> 
> On 2013-06-29, at 23:34, Igor Stasenko <siguc...@gmail.com> wrote:
>> yes, i don't know if it good or bad, but i'd rather prefer that traits
>> applied to Behavior,
>> but not to Class (which has two entangled behaviors). But maybe for
>> human comprehension it is better..
>> but not for implementing, because it certainly makes model more complex.
>> 
>> On 29 June 2013 22:52, Camillo Bruni <camillobr...@gmail.com> wrote:
>>> 
>>> On 2013-06-29, at 22:32, Igor Stasenko <siguc...@gmail.com> wrote:
>>> 
>>>> On 29 June 2013 21:21, Stéphane Ducasse <stephane.duca...@inria.fr> wrote:
>>>>> 
>>>>> On Jun 29, 2013, at 8:19 PM, Igor Stasenko <siguc...@gmail.com> wrote:
>>>>> 
>>>>>> On 29 June 2013 20:12, Camillo Bruni <camillobr...@gmail.com> wrote:
>>>>>>> Working on the new class builder I have a hard time figuring out the 
>>>>>>> full trait
>>>>>>> semantics.
>>>>>>> 
>>>>>>> If I use a trait on instance side, does that imply that its classTrait 
>>>>>>> on the
>>>>>>> metaclass?
>>>>> 
>>>>> No. I do not think so (I will have to think).
>>>>> Normally Trait and ClassTrait are two different classes. NOw I do not 
>>>>> remember if a trait is composed
>>>>> of a classTrait too.
>>>>> 
>>>> Trait has 'classTrait'
>>> 
>>> yes, but the strange part is, that if you use a Trait on the instance-side 
>>> it
>>> will automatically install the class trait as well.
>>> 
>>>       ClassDescription subclass: #Class
>>>               uses: TClass
>>>               ...
>>> 
>>> and the users
>>> 
>>>       TClass users => an IdentitySet(Class)
>>>       TClass classTrait users => an IdentitySet(Class class)
>>> 
>>> so in this case it implies that when you use a Trait on the instance side 
>>> it will
>>> apply also it's classTrait to the class side. So is it ok then to enforce 
>>> that in
>>> the new class builder?
>>> 
>>> Currently you can do the following in the new class builder:
>>> 
>>>       PharoClassInstaller make: [:builder|
>>>               builder
>>>                       superclass: Object;
>>>                       name: 'Foo';
>>>                       traitComposition: TClass ]
>>> 
>>> which will explicitely NOT install `TClass classTrait` in `Foo class`.
>>> Does this behavior make sense?
>> 
>> 
>> 
>> -- 
>> Best regards,
>> Igor Stasenko.
>> 
> 
> 


Reply via email to