On Fri, Apr 23, 2004 at 03:00:57PM -0700, Jonathan Lang wrote:
: Can role definitions be nested?  That is: 
: 
:   role A {
:     role subRole1 {...};
:     role subRole2 {...};
:     ...
:   };
: 
: As I see it, this ought to be equivelent to 
: 
:   role A::subRole1 {...};
:   role A::subRole2 {...};
:   role A {
:     does A::subRole1; does A::subRole2; 
:     ...
:   };
: 
: The advantage of doing things this way is that you'd be able cluster
: related attributes and methods together within a role (or within a class,
: for that matter) - clusters which make sense within the main role, but
: probably don't have enough importance to be created as "standalone" roles.

I don't think a nested role would automatically "do" itself, but you
could probably say:

    role A {
        does role subRole1 {...};
        does role subRole2 {...};
        ...
    };

At which point we all gang up on you and beat you to a pulp for being
overly analytical.  :-)

Larry

Reply via email to