On Thu, Nov 17, 2005 at 01:55:31PM -0800, Ovid wrote:
: 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?

Only sorta.  A role has its own lexical scope that the class is not
privy to, and lately we're trying to manage privacy via lexical scoping
as much as possible.

: 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.

In Perl 6 imports are lexical by default, so that shouldn't be a problem.

: 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

Please don't rely on perl.com for the latest design docs.  I just
checked in a new S12 to svn.perl.org a few minutes ago that hopefully
covers most of the questions raised here and on perlmonks.  Doubtless
there will be more issues, but that's the nature of the beast.

I'll need to go and install some Update sections in A12, but bein's as
it's 2:00 in the morning I'm going to bed...

Larry

Reply via email to