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

rfc: additional accessors for Hash native trait

From:
Chris Weyl
Date:
April 16, 2011 13:21
Subject:
rfc: additional accessors for Hash native trait
Message ID:
BANLkTi=yAon40eK-fNg=5J535dXpktNx-w@mail.gmail.com
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:


https://github.com/RsrchBoy/moose/compare/topic%2Fmore-native-trait-accessors

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)

Thanks-
                              -Chris

-- 
Chris Weyl
Ex astris scientia



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About