Who's going to make Moose class declarations simpler?
A Stackoverflow answer that encourages the questioner to use Moose has a long code example because it has a lot of code and formatting since there is a lot of repeated typing:
has 'PacketName' => ( is => 'rw', isa => 'Str', required => 1, ); has 'Platform' => ( is => 'rw', isa => 'Str', required => 0, ); has 'Version' => ( is => 'r', isa => 'Int', required => 1, );
I'd like to see that look something like little language this instead, perhaps in a INI style format. Assume that the attributes are
required (or whatever the defaults should be) and only express the deviations:
# file is fooclass.moose or something [has] PacketName Platform not_required Version isa Int is r
Ultimately, I'd like to see a non-code text description of a class come from configuration rather than code. I've talked to random Moose people around this and they've never shot it down (to my face :). I've done this for non-Moose things, some of which I talk about in Mastering Perl, but that you can also see in some of my work on Data::Constraint and Brick.
I know there are a lot more fancy things that you can do and you might use code to figure some of that out, so you wouldn't use this in those cases. However, in the newbie, simple class case, it's a lot less scary to see a little code than a lot of code.
It's not very high on my to do list, though, so steal the idea if you like it.