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.
-
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.
|