Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Much of A12 is, as you pointed out, about implementation. To us mere mortals, it's the kind of thing that's interesting to know, but really I didn't try too hard to understand the dispatching details. All I need to know is that I can write methods with the same name and different signatures and it will work. And I barely more than skimmed any paragraph that mentioned an ALLCAPS sub. Things like BUILD, BUILDALL, AUTOMETH, etc., are just kind of vague things that do stuff I probably won't need to change in the near future, if ever.

Roles are more for the Class Writer than the User. They're just little bits of abstracted behavior that you can throw into classes that need the behavior. They're useful to get away from writing lots of abstract classes that just contain behavior and then doing multiple inheritance all over.

As a Class User, you pretty much just do what you do now. As long as the Writer has done their job correctly, you just do:

use SomeClass; my $obj = SomeClass.new; $obj.something; # etc.
In fact, even deriving from a class that uses Roles doesn't require knowing about them. To your derived class, any methods implemented as Roles in the base class look like any other derived method to your class.

I'm not too sure about Traits, myself, so I'll refrain from commenting on them at all. A good example involving what Traits are and how to use them would be my request for E12.


In reply to Re: Re: On the Improvement of Exegesis 12 by kelan
in thread On the Improvement of Exegesis 12 by Anonymous Monk

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-19 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found