Sam Vilain wrote:
TSa wrote:
is this subject not of interest? I just wanted to start a
discussion about the class composition process and how a
role designer can require the class to provide an equal
method and then augment it to achieve the correct behavior.
Contrast that with the need to do the same in every class
that gets the equal method composed into if the role doesn't
have a superclass interface as described in the article.
This will be the same as requiring that a class implements a method,
except the method's name is infix:<==>(::T $self: T $other) or some such.
How does a Role require that the target class implement a method (or
do another Role)?
Does the "class GenSquare does GenEqual does GenPointMixin" line imply
an ordering of class composition? This would seem to be required for
the super.equal hand-wave to work but part of the Traits Paper goodness
came from avoiding an ordering. Composition is just order insensitive
flattening. Conflicts like the equal method in the OP have to be
explicitly resolved in the target class, either using aliases
or fully qualified names. So there's no super needed.
I would like a way to make one Role to require that the target class
"does" another abstract Role, is there already such a technique?
(I should confess that I haven't yet read the OP linked article),
Brad