--- chromatic <[EMAIL PROTECTED]> wrote:

> > "$p1 must be like a Point, but it needn't actually
> > be a Point.  Both $p2 and the return value must be the same type of
> > thing that $p1 is."
> 
> That was always my goal for roles in the first place.  I'll be a
> little sad if 
> Perl 6 requires an explicit notation to behave correctly here -- that
> is, if 
> the default check is for subtyping, not polymorphic equivalence.

I had initially thought this, but think about the case where someone
wants to rewrite something to be compliant to another interface.  If I
pass a CGI::Simple object to a method expecting a CGI object, there's
an excellent chance that it will *just work*, even though there's no
relation between the two.  In this case, a role really doesn't work.

Of course, the '£' might not work either since we're not specifying
that we only need a subset of the behavior to work properly.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog     - http://use.perl.org/~Ovid/journal/

Reply via email to