Traits

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

Traits

MrGwen
Hi,

I've made an implementation of the traits: Traits are a simple composition
mechanism for structuring object-oriented programs. A Trait is essentially a
parameterized set of methods; it serves as a behavioral building block for
classes and is the primitive unit of code reuse. With Traits, classes are
still organized in a single inheritance hierarchy, but they can make use of
Traits to specify the incremental difference in behavior with respect to their
superclasses.

This is a young version: so the traits don't have state (In my first prototype
they have it). That's pretty easy to add and the next step on my to do list.

git://github.com/MrGwen/gst-traits.git

Cheers,
Gwen

http://en.wikipedia.org/wiki/Trait_%28computer_science%29
http://scg.unibe.ch/research/traits/

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Traits

Paolo Bonzini-2
On 06/13/2010 11:46 AM, Gwenael Casaccio wrote:
> This is a young version: so the traits don't have state (In my first prototype
> they have it). That's pretty easy to add and the next step on my to do list.

Are there any papers about stateful traits?

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk