G'day cavac,

++ Thanks for this meditation.

I was looking at class a week or two ago (when I first noticed v5.37.9 had been released). I had thought that I might install v5.37.9 to check it out (with actual code tests) but decided against that for two reasons:

"... i think this new system shouldn't give up any of the flexibilities ye olde 'bless' provides."

Perhaps unintentionally, you have spoken (in various parts of your post) as if class was intended as a replacement for bless. As ++haj wrote: "bless isn't going to go away".

Given "It [class] isn't a bless wrapper, but a completely new system built right into the perl interpreter."[perlclass: History], it would be interesting to benchmark bless-based and class-based new() functions.

Currently, a class uses a '.../lib/Some/Class.pm' file which starts with 'package Some::Class;' (and, yes, I acknowledge that's an oversimplification). One of the things that I was interested in testing was whether simply changing 'package' to 'class' would still work in the current framework (e.g. @INC variable, parent pragma, 'SUPER' pseudoclass, and so on).

The current documentation for class is extremely sparse. Given most of the documentation is in perlclass, the addition of a link to that should be a bare minimum. It does say that it "behaves similarly to package" but doesn't go into any detail beyond "... except that the newly-created package behaves as a class." — that strikes me as vague and terse, albeit accurate.

— Ken


In reply to Re: Thoughts on new 'class' OO in upcoming perl by kcott
in thread Thoughts on new 'class' OO in upcoming perl by cavac

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.