In http://perlmonks.org/?node_id=509413 (in response to
http://perlmonks.org/?node_id=509256), Rob Kinyon wrote that in his
understanding of Perl 6 Roles, anything a role can do the class "doing"
the role should also be able to do.

Is this correct?  I'm getting bitten with Class::Trait because some of
my traits import helper functions and constants from other packages. 
The classes implementing the traits should *not* care about how the
trait does something, but those functions and constants are getting
flattened into my classes and this has been causing all sorts of
problems.

For the time being, I have rewritten all of my traits to not import
anything in the trait namespace, but I intend to modify Class trait so
each method can be defined thusly:

  sub some_method : Public { ... }

In the original traits definition, as I understood them, a trait should
specify what it requires *and* what it provides.  Are Perl 6 roles
really going to blindly export everything they contain?  This seems a
serious mistake.  I didn't see anything addressing this issue in
http://www.perl.com/pub/a/2004/04/16/a12.html?page=12

Cheers,
Ovid

-- 
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

Reply via email to