From: Matt S Trout Date: Sun, 6 May 2012 19:06:57 +0000 (+0000) Subject: update incompatibilities docs X-Git-Tag: v0.091003~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoo.git;a=commitdiff_plain;h=f9755246a7eec67300ed639a439be560a12551db update incompatibilities docs --- diff --git a/Changes b/Changes index 223c3f5..85228e5 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - update the incompatibilities section since we're less incompatible now - fix coderef naming to avoid confusing autoclean 0.091002 - 2012-05-05 diff --git a/lib/Moo.pm b/lib/Moo.pm index e352f1a..545e80a 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -308,10 +308,13 @@ them like 'use base' would. =head2 with with 'Some::Role1'; - with 'Some::Role2'; -Composes a L into current class. Only one role may be composed in -at a time to allow the code to remain as simple as possible. +or + + with 'Some::Role1', 'Some::Role2'; + +Composes one or more L (or L) roles into the current +class. An error will be raised if these roles have conflicting methods. =head2 has @@ -486,19 +489,6 @@ aware can take advantage of this. =head1 INCOMPATIBILITIES WITH MOOSE -You can only compose one role at a time. If your application is large or -complex enough to warrant complex composition, you wanted L. Note that -this does not mean you can only compose one role per class - - - with 'FirstRole'; - with 'SecondRole'; - -is absolutely fine, there's just currently no equivalent of Moose's - - with 'FirstRole', 'SecondRole'; - -which composes the two roles together, and then applies them. - There is no built in type system. C is verified with a coderef, if you need complex types, just make a library of coderefs, or better yet, functions that return quoted subs. L provides a similar API @@ -516,7 +506,11 @@ C are more likely to be able to fulfill your needs. There is no meta object. If you need this level of complexity you wanted L - Moo succeeds at being small because it explicitly does not -provide a metaprotocol. +provide a metaprotocol. However, if you load L, then + + Class::MOP::class_of($moo_class_or_role) + +will return an appropriate metaclass pre-populated by L. No support for C, C, C, or C - override can be handled by around albeit with a little more typing, and the author considers @@ -529,12 +523,14 @@ using C<$obj-E$::Dwarn()> instead. L only supports coderefs, because doing otherwise is usually a mistake anyway. -C is not supported per se, but of course it will work if you -manually set all the options it implies. +C is not supported; you are instead encouraged to use the +C 'lazy'> option supported by L and L. C is not supported since the author considers it a bad idea. -C is not supported since it's a very poor replacement for POD. +C will show up in a L metaclass created from your class +but is otherwise ignored. Then again, L ignors it as well, so this +is arguably not an incompatibility. Handling of warnings: when you C we enable FATAL warnings. The nearest similar invocation for L would be: