Hi all, I'm doing some work with traits, and I found something like this
case:

Trait T1>>m1
     ^self requirement

Trait T2>>m1
    doSomeStuff

Class C1 uses: T1 + T2
[note, i'm not excluding m1 from T1 in the T1 + T2 composition.]
And the resulting:
C1>>m1
    doSomeStuff

It is just ok, since the other m1 is just a mark for a requiredMethod, but I
find this a little weird, since do not follow the Trait definition. (at
least the one I read, maybe it changed!).  Wouldn't be better to
automatically add the exclusion at the composition? 
Class C1 uses: T1 - {#m1} + T2

In this way the definition would be followed without any exception (and it
will be explicit with what is going on).  This is just a suggestion, anyway
it works great!

btw... why there are two requirement marks?: 
Object>>requirement
        self error: 'Implicitly required method'

Object>>explicitRequirement
        self error: 'Explicitly required method'

the question is, if I use #requirement, I'm explicitly requiring that
method.  Is there any situation where I should use #requirement?

Cheers

-- 
View this message in context: 
http://forum.world.st/trait-composition-conflict-autoresolution-tp2235790p2235790.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to