Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I don't know if it was a feature generally found useful, or just a lone cowboy effort.

The reason (as best I know) was that DBIx::Class was using the Class::C3 module, which I wrote the first version of as a sorta-kinda-joke-maybe-not, but Matt Trout (author of DBIx::Class) decide was really useful for keeping his Multiple-Inheritance hierarchy sane. My version was quite slow and basically a naive poor quality port of a Python version until Brandon took it over and promptly re-wrote it faster and eventually in XS. From there (I assume, cause I wasn't heavily involved) he petitioned p5p wrote tests and patches and got them to accept core changes that would make it possible for Perl to support the C3 MRO natively.

So basically, no it wasn't lone-wolf-hey-this-is-neat-lets-add-it, it was backed by a serious need in a major module that had lots of community support behind it, and it was something that was not easily and cleanly accomplished outside of the core.

As for the patch you have described, I would say that it is better as a module then a core addition. The reason being is that I can very easily see it causing issues with existing code (DarkPAN as they call it). I know I am guilty of occasionally using an imported function as a method (mostly just abusing Scalar::Util::blessed so that $obj->blessed returns the class it is blessed into) and I am sure many others are too. As for adding methods to a random SV, this is a major language feature and while cool probably breaks the well established package<->class relationship.

-stvn

In reply to Re^3: new features in perl5 - who needs it? by stvn
in thread new features in perl5 - who needs it? by dk

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 imbibing at the Monastery: (4)
As of 2024-03-28 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found