[squeak-dev] Re: How about... something completely different? (Re: Re: On traits composition)

Andreas Raab andreas.raab at gmx.de
Wed Dec 9 00:08:39 UTC 2009


Hi Göran -

Unbelievable. You basically just described the very idea that started 
this whole traits thing. When Nathanael worked with us at Disney, the 
traits direction came out of discussions where we wanted him to think 
precisely along the lines you're describing. My original thoughts on 
this matter was that I wanted to have something more like (biological) 
cells - entities that are made up of smaller things (objects), that have 
an inside and an outside (made up of other objects instead of 
abstractions like the interface/implementation distinction), that 
forward signals (messages) to the appropriate receptors etc. What you're 
describing is very much in line with my thoughts at that point which 
also included more actor-like structures (some of which was later 
realized in Tweak and once I found E got an even stronger version in 
Croquet).

Cheers,
   - Andreas

Göran Krampe wrote:
> Hi all!
> 
> Andreas Raab wrote:
>> BTW, I really don't think there is much difference between mixins and 
>> traits; all forms of MI are fairly equivalent.
>>
>> Cheers,
>>   - Andreas
> 
> As most of us I was also very positive when Traits first came to the 
> scene. Now, I am a lot more jaded and think "well, sure, but are they 
> worth it?".
> 
> Given Andreas' statement above - wouldn't it be *much* cooler to evolve 
> Smalltalk along the axis of composition instead of the axis of inheritance?
> 
> I have always thought that having better mechanisms for delegation would 
> be awesome, and would in most ways be much more powerful than 
> inheritance (in whichever form).
> 
> For example, what if one could declare that for class Foo (having ivars 
> x, y, z) any message that would result in a DNU would instead be 
> "delegated" to ivar x (and then y if no lookup is found in x either).
> 
> This would be equivalent to tons of messages in Foo like:
> 
> Foo>>name
>     ^(x respondsTo: #name) ifTrue: [x name] ifFalse: [y name]
> 
> (well, kinda, you get the picture - but also, taking care of x/y 
> returning "self" in which case we probably should return the "Foo self" 
> instead etc)
> 
> In many ways the mechanism I am describing is "built into" languages 
> like self and Slate (I think).
> 
> IMHO the above is very useful and would allow fine grained composition 
> similar to Traits but in a dynamic more object centric fashion.
> 
> regards, Göran
> 
> 
> 




More information about the Squeak-dev mailing list