Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Roles don't -have- attributes.

Hm. The quote was directly from Synopsis 12, so as far as the wording is concerned, you need to argue with the authors.

As far as the semantics are concerned, I did go on to say: "Of course, whatever state they have becomes a part of the instance into which they are composed", so I think we're in tune there.

But, as I also said, and regardless of whether the state is has'd by the Role, or provided by it, that state exists and is presumably usually affected by the Role and persists beyond the invocation of whatever methods the role also provides, so there is no sense in which it can reasonably be described as stateless.

If my limited understanding of ML's Functors means that they are like (my also limited understanding of) Haskell's Typeclasses, then the term composed in the sense you are using it: "composed into"; and that same term in the sense the OP used it: "more easily composable units."; are entirely different things.

With the former composing both operations and state, and the latter performing operations on values only (hence stateless). Quite different beasts. The best discussion I have located upon the difference is this.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Roles and functional programming by BrowserUk
in thread Roles and functional programming by zby

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (8)
    As of 2014-12-20 04:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (95 votes), past polls