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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.