Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re: RFC: Concise OOP Syntax by daxim
in thread RFC: Concise OOP Syntax by LanX

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 perusing the Monastery: (7)
As of 2024-03-28 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found