Subject: | Difficult for a non-Moose class to use a Moose role. |
Let's say I'm refactoring Moose into a big legacy app. I refactor
something to be a Moose::Role and then I want to use that role in a
non-Moose class.
I can't do C<< use Moose 'with'; with "MyRole"; >> because that will
turn my non-Moose class into a Moose::Object subclass possibly messing
up my inheritance chain.
I can't do C<< use Moose::Util qw(apply_all_roles); apply_all_roles(
__PACKAGE__, "MyRole" ); >> because that wants a MOPified class.
apply_all_roles() (or something in its stack) could take my class name
and make a metaclass object or whatever is necessary to make Moose take
notice of it. This would make using Moose roles in non-Moose classes
much easier.