in reply to Re: Roles and functional programming
in thread Roles and functional programming
Roles don't -have- attributes. Roles can -provide- attributes to the classes they are composed into. If you have a Cat and Dog, each of which does Pet, then if you have a $cat instance and a $dog instance, the $.collar attribute of each is separate. They aren't shared in any sense. Therefore, Perl6 roles -are- stateless in that the role itself doesn't have any state. (Which makes sense given that you cannot instantiate a role.)
My criteria for good software:
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Roles and functional programming
by BrowserUk (Patriarch) on Dec 01, 2008 at 22:54 UTC | |
by dragonchild (Archbishop) on Dec 02, 2008 at 04:29 UTC |
In Section
Seekers of Perl Wisdom