From: Chris Prather Date: Wed, 8 Jul 2009 14:21:33 +0000 (-0400) Subject: re-word the Trait/Role differentiation text to explain Traits are Roles applied to... X-Git-Tag: 0.88~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=713eb831df244a9b46b759d386c6a7e8a950cca4;p=gitmo%2FMoose.git re-word the Trait/Role differentiation text to explain Traits are Roles applied to metaclasses since it came up on StackOverflow --- diff --git a/lib/Moose/Cookbook/Extending/Recipe1.pod b/lib/Moose/Cookbook/Extending/Recipe1.pod index 46dd5fe..a20a1b7 100644 --- a/lib/Moose/Cookbook/Extending/Recipe1.pod +++ b/lib/Moose/Cookbook/Extending/Recipe1.pod @@ -109,13 +109,12 @@ this works. These both build on top of the L extension. =head1 ROLES VS TRAITS VS SUBCLASSES -It is important to understand that B. A role can be used as a trait, and a trait is a role. The only -thing that distinguishes the two is that a trait is packaged in a way -that lets Moose resolve a short name to a class name. In other words, -with a trait, the caller can refer to it by a short name like "Big", -and Moose will resolve it to a class like -C. +It is important to understand that B. A +trait is simply a role applied to a metaclass. The only thing that may +distinguish the two is that a trait can be packaged in a way that lets Moose +resolve a short name to a class name. In other words, with a trait, the caller +can refer to it by a short name like "Big", and Moose will resolve it to a +class like C. See L and L for examples of traits in action. In