----- Original Message ----

> From: TSa (Thomas Sandlaß) <tho...@sandlass.de>

> > >> So what the OP wants to do is declare a method that is available on
> > >> all those invocants - and only those invocatnts - which do all of
> > >> roles X, Y, and Z.  Granted, you can declare a new role XandYandZ
> > >> that does X, Y, and Z, and define the method there, but that won't
> > >> work on $foo unless you declare explicitly  '$foo does
> > >> XandYandZ' .  The goal is to have the method show up no matter how
> > >> $foo comes to do all three roles.
> >
> > Right.
> 
> I have difficulty seeing the need for a method here. The distinguishing
> feature of a method is the access to the private data of an object that
> can hardly be granted by doing the three roles X, Y and Z. After all
> there's no unique implementation of these roles!

I believe I started this thread, unless we mean "John Lang" as the OP after the 
rename.

"Private state" is actually a separate issue and one which the traits 
researchers already dig into. I was asking the special case where:

1. A class consumes two (or more) roles
2. Each roles provides a method with an identical signature
3. The methods are not equivalent and neither role can rely on the other's 
method

 
With that, you have roles which cannot be composed. You must rewrite one (bad 
if you don't own it), or omit one..

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Reply via email to