[go: nahoru, domu]

Moose (Perl): Difference between revisions

Content deleted Content added
Rfl (talk | contribs)
Line 26:
===Roles===
 
ARoles rolein isMoose somethingare thatbased aon class[[Trait does(computer science)|Traits]]. ItThey isperform somewhata likesimilar task as [[mixin]]s, orbut are composed horizontally rather than inherited. They are also somewhat like [[Interface (computer science)|interfaces]] inbut otherunlike [[object-orientedinterfaces programmingthey language]]s.can Unlikeprovide mixinsa anddefault interfaces,implementation. rolesRoles can be applied to individual instances as well as Classes.
 
* A role has zero or more attributes.