[ANN] Traits beta2.1 stable kernel

stéphane ducasse ducasse at iam.unibe.ch
Sun Mar 13 21:02:03 UTC 2005


On 13 mars 05, at 21:40, Ruben Bakker wrote:

> I studied some of the documents provided the traits homepage and
> played with a beta 2.1 image. My first impression: The traits system
> is a very natural extension to Smalltalk, powerful and still easy to
> learn!

Thanks this was our intention. Simple but powerful :)
>
> OK, now my first question:
> --------------------------------------
> TNumberable>>squared
> 	"Answer the receiver multiplied by itself."
>
> 	^ self * self
> In squared we call self * self. I searched for the following method 
> definition:
> TNumberable>>*
>         self requirement
>
> but couldn't find it... What did I miss in the example?

Squared is provided assuming that you can define * on your class that 
deals with number.
* is not part of numerable but required because for normal number you 
will get a primitive call
and for complex the complex number multiplication.
Still you can share TNumerable between Complex and Number

So look in the class that use the trait you will see that * is supplied 
:)

>
> second question:
> -------------------------
> I suppose "super" is not allowed inside a trait, right? I tried it,
> but the compiler didn't give me an error.

No you can use super but by doing so you are designing a not so cool 
trait that have knowledge
about the fact that it should skip a level in the inheritance chain. So 
you see this is fishy.
But nothing in the model prevent you to do that. In addition this may 
be needed if we want to
traitify old code :)

Stef

>
> Ruben
>
>
>
> On Thu, 10 Mar 2005 15:15:55 +0100, Adrian Lienhard <adi at netstyle.ch> 
> wrote:
>> Hi all,
>>
>> This release of Traits on SqueakMap is supposed to serve as  a first
>> demo for people who want to try out Traits and have a look at the
>> implementation. It also includes the implementation of the class
>> Complex as a simple example of using Traits.
>>
>> Please see the version comment below for more information.
>>
>> Adrian
>>
>> Traits Release beta2.1 for Squeak3.7
>> ====================
>>
>> In this version the new language kernel featuring Traits is
>> refactored/bootstrapped. We consider the kernel being complete and
>> stable (gamma).
>>
>> Features concerning the user interface, especially the code browser,
>> that are crucial for getting the real "traits experience" are in work
>> and are not contained in this release. To be able to already use 
>> Traits
>> there is a basic traits browser which is based on OmniBrowser (World
>> menu->open->Traits Browser).
>>
>> This release now also contains a very simple example of Traits: the
>> implementation of Complex which was refactored to share a trait with
>> the class Number to avoid code duplication.
>>
>> Please find more information and papers about Traits at:
>> http://www.iam.unibe.ch/~scg/Research/Traits
>>
>> Installation
>> ------------
>> The implementation is available as a SAR file on SqueakMap. It is
>> tested in a new fresh 3.7 image. Prerequisite package is Monticello.
>>
>> Please note, that the installation takes about 30 Minutes (depending 
>> on
>> the speed of your machine) because it needs to recompile all the
>> classes in the image. (This is a consequence of the fact that we had 
>> to
>> change the format of the kernel classes.)
>>
>> Getting Started
>> ---------------
>> Open the Traits OmniBrowser: World Menu -> open -> Traits Browser
>> Create a new trait: Open the context menu in the class/trait pane and
>> select "create trait..."
>>
>> UI Limitations of this release
>> -----------
>> - There are still many features missing that are absolutely essential
>> for getting the real "traits experience", but these are mainly related
>> to the UI and IDE. For example:
>>    - There are no virtual categories that present the conflicts and 
>> glue
>> methods of a composite class/trait.
>>    - There is no automatic computation of requirements
>>    - There is no information that shows which traits/classes provide 
>> or
>> require the currently selected methods
>>    - There is no support for turning classes into trait
>>
>>
>




More information about the Squeak-dev mailing list