Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I must say I don't feel much for you choice of names for the parameters, most of all, for the "is". It's too vague. This reads just as natural as yours, doesn't it?

    has 'x' => (is => 'Int');

    And "isa" sounds more like a tradition, than as a good name.

    What names would I propose? I don't think I have found really good names, but I have a few suggestions. For "is", I'd call it "access". After all, you're trying to control the access rights to the attribute. As for the other, I'm thinking of something lik

    • Well, is => 'rw' and is => 'ro' are borrowed directly from Perl 6. And 'isa' has a very well known meaning in the Perl community, so I would rather stick to that then try to create my own. As for dropping the name for the type, this would force an ordering on the options list, which would make things trickier.

      The changes you suggest could easily be done using Moose::Policy as well, see Moose::Policy::FollowPBP [cpan.org] for an example. Basically you just preprocess the %options passed to has and turn them into something Moose recognizes. In fact, is => 'rw' is just a macro for accessor => 'foo' and is => 'ro' for reader => 'foo'.

      - Stevan