Hi frank
normally it does not make sense to use two times the same trait. So I do not
really understand
how it could work.
So now when you have two traits
T1
T2
minus lets you erase selectively one message x from T1 if it is also available
in T2
and without having to redefine it into the composite.
Stef
> I have a Trait TGroup that requires #*, #identity and #inverse. I want
> to construct a TField by composing TGroup with itself. One TGroup will
> form the operations #*, #one, and #reciprocal while the other will
> form #+, #zero and #negated.
>
> I don't want #identity or #inverse, because these apply to one
> operation, and it makes TField's API ambiguous. That's what
> TraitExclusion is for.
>
> I had thought I could say
>
> (TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} + TGroup @
> {#identity->#one. #inverse->#reciprocal}) - {#identity. #inverse}
>
> but TraitComposition >> #- says that exclusion binds tighter than +.
> So in effect the above composition is the same as
>
> TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} + (TGroup @
> {#identity->#one. #inverse->#reciprocal} - {#identity. #inverse})
>
> In short, to remove the undesirable #identity and #inverse I have to
> exclude from both sides of the composition:
>
> TGroup @ {#identity->#zero. #* -> #+. #inverse->#negated} -
> {#identity. #inverse} + TGroup @ {#identity->#one.
> #inverse->#reciprocal} - {#identity. #inverse}
>
> My question is this: what is the reason for - binding more tightly
> than +? Why is it _not_ desirable to have - distribute over +?