Stateful Traits

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Stateful Traits

Balázs Kósi
Hi all!

I've read the paper about traits some time ago. [1]
I finished reading the presentation about stateful traits. [2]
The initialization of the traits instance variables are not very clear
for me. Can somebody explain it?

thanks: balazs

[1] http://www.iam.unibe.ch/~scg/Archive/Papers/Scha03aTraits.pdf
[2] http://88.191.19.63/esug/presentations/monday/RT/3-2006-StatefulTraits-ESUG.pdf

Reply | Threaded
Open this post in threaded view
|

Re: Stateful Traits

stephane ducasse-2
this is a good question :)
But so far there is nothing special for that
        you can define a method on the trait
        and invoke it via new when you create an object

Now this is not really cool because

        T1>>initialize

                foo := 3

        T2>>initialize
                bar := 4

        C = T1 + T2
                => conflicts
                so we should use alias and this is not really what we want

        C>>initialize
                self T2initialize
                self T3initialize
       

Note that stateful traits is more experimental than stateless one.


> Hi all!
>
> I've read the paper about traits some time ago. [1]
> I finished reading the presentation about stateful traits. [2]
> The initialization of the traits instance variables are not very clear
> for me. Can somebody explain it?
>
> thanks: balazs
>
> [1] http://www.iam.unibe.ch/~scg/Archive/Papers/Scha03aTraits.pdf
> [2] http://88.191.19.63/esug/presentations/monday/RT/3-2006- 
> StatefulTraits-ESUG.pdf
>