> On 09 Feb 2015, at 18:24, Nicolai Hess <[email protected]> wrote:
> 
> I thought, Behaviors define the "behavior" of objects, therefore:
> 
> Integer is a behavior, because it defines the behavior of "integer objects"
> Integer class is a behavior because it defines the behavior of the object 
> "Integer".
> 
> 5 isBehavior -> false.
> Integer isBehavior -> true.
> Integer class isBehavior -> true.
> 
> What about Traits?
> 
> Traits are "behavioral(?)", but they don't define the behavior alone, only 
> the composition of
> Traits in an actual class defines the behavior of an Object.
> 
> TClass isBehavior -> false.
> 
> So far so good.

In fact the first time I saw this I was a bit surprised, I was expecting it to 
return true.
After all Trait class inherits TraitBehavior that uses the TBehavior trait. 
Sure a trait alone doesn’t define the whole behavior of an object but at least 
part of it.
In fact it’s because there is many senders of isBehavior which expect it to 
return true only if the receiver is instanciable.
But still it’s a bit confusing.

> Smalltalk globals allBehaviors includes:TClass -> true !
> 
> No suprise, because #allBehaviors explicitly collect all classes and traits.
> But the question is, what do we want to call a "Behavior”?

I would prefer isBehavior to return true for traits and rename the current 
isBehavior to isInstanciable for exemple.
But this is quite a refactoring and it’s likely to break many things that are 
not in the image by default.

Likewise in SystemDictionary and SystemNavigation:
> All Classes and MetaClasses (-> Behavior allSubclasses)

-> allInstanciable or allClassesAndMetaclasses

> All Classes and Traits

-> allInstanceSideBehaviors (and an equivalent allClassSideBehavior for 
metaclasses and classtraits)

> All Classes and Traits and MetaClasses and ClassTraits

-> allBehaviors

> All Classes and MetaClasses and some Traits?

not this one

> (this of course, is related to 
> http://forum.world.st/RBEnvironments-allClasses-Traits-Meta-tp4796370.html 
> <http://forum.world.st/RBEnvironments-allClasses-Traits-Meta-tp4796370.html>).
> 
> In squeak Traits are behavior too.

Yes, it’s because in squeak traits are implemented differently: the class Trait 
inherits from Behavior so traits are instanciable.

> 
> 
> nicolai
> 
> 

Reply via email to