From: Jesse Luehrs Date: Mon, 10 May 2010 21:47:33 +0000 (-0500) Subject: move some metaclass compat docs back to cmop X-Git-Tag: 1.05~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b92160448c942dbd837a2cd57fa3407491c583b2;p=gitmo%2FMoose.git move some metaclass compat docs back to cmop --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 78d4239..18a9fbe 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -979,28 +979,15 @@ reading the "About Metaclass compatibility" section in the C docs. Moose will attempt to resolve a few cases of metaclass incompatibility -when you set the superclasses for a class, unlike C, which -simply dies if the metaclasses are incompatible. - -In actuality, Moose fixes incompatibility for I of a class's -metaclasses, not just the class metaclass. That includes the instance -metaclass, attribute metaclass, as well as its constructor class and -destructor class. However, for simplicity this discussion will just -refer to "metaclass", meaning the class metaclass, most of the time. - -Moose has two algorithms for fixing metaclass incompatibility. - -The first algorithm is very simple. If all the metaclass for the -parent is a I of the child's metaclass, then we simply -replace the child's metaclass with the parent's. - -The second algorithm is more complicated. It tries to determine if the -metaclasses only "differ by roles". This means that the parent and -child's metaclass share a common ancestor in their respective -hierarchies, and that the subclasses under the common ancestor are -only different because of role applications. This case is actually -fairly common when you mix and match various C modules, -many of which apply roles to the metaclass. +when you set the superclasses for a class, in addition to the cases that +C handles. + +Moose tries to determine if the metaclasses only "differ by roles". This +means that the parent and child's metaclass share a common ancestor in +their respective hierarchies, and that the subclasses under the common +ancestor are only different because of role applications. This case is +actually fairly common when you mix and match various C +modules, many of which apply roles to the metaclass. If the parent and child do differ by roles, Moose replaces the metaclass in the child with a newly created metaclass. This metaclass