develooper Front page | perl.moose | Postings from April 2011

rfc: additional accessors for Hash native trait

Chris Weyl
April 16, 2011 13:21
rfc: additional accessors for Hash native trait
Message ID:
Hey all --

I've had occasion to need and use a couple array-like accessors for
attributes using the Hash trait, on both sets of keys and values:
map_{keys,values}, grep_..., sort_....   These new accessor traits just
compose Array and Hash accessor traits together to get the desired results,
using the framework that's been in place since 1.15.  They have basic tests,
but the docs haven't been updated for them yet.

I've created a topic branch out on github at:

I'd like to get these on the CPAN, but I'm not entirely sure of the best
direction to proceed at this point.  I'm OK with trying for merging with
Moose, or doing a standalone MooseX.

Does this meet the definition of a "new feature" that should be run through
a MooseX package first?

If so, would there be objection to
using Moose::Meta::Method::Accessor::Native:: namespace publicly, privately,
or should they be elsewhere?  --if elsewhere, I suspect some tweaking of
Moose::Meta::Attribute::Native::Trait::_native_accessor_class_for() will be
needed to look in other namespaces (or at least to make it easy to do so).

If not, would this be looked on favorably as an RFC branch?  (assuming the
docs are updated to first)


Chris Weyl
Ex astris scientia Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About