As I've told you several times, your assumptions
[m]ost of us are stuck with an older version of Perl and
[t]he crucial problem for the acceptance is backwards compatibility are just not true. (I don't know the name of the logical fallacy, but essentially you project your own position and circumstances onto everyone.) You burden yourself with a lot of work that is based on false premises and – if finished – is realistically useful only to a minuscule amount of users.
The rest can (and could for years) install Moops and get to enjoy superb class/roles/methods/types syntax sugar.
use Moops;
use Data::Dx;
class BLA extends SOME::PARENT with SOME::ROLE, ANOTHER::ROLE {
has x => is => 'rw', isa => Int, writer => 'set_x', default => 10;
has y => is => 'rw', isa => Int, writer => 'set_y', default => 11;
method print_x() {
printf "x = %s\n", $self->x;
}
method dump() {
Dx $self;
}
}
my $bla = BLA->new;
$bla->set_x(42);
$bla->print_x;
$bla->dump;
If I had your skill and internals knowledge, I would improve Moops to add sugar for self-less attributes and less verbose attribute declarations.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.