On Wed, Jan 13, 2010 at 06:59:56PM +0100, Dmitry Karasik wrote:
> Now just to step back, I'd like to ask for help solving the original
> problem, - how would I install accessor in a trait or a metaclass?

One approach would be to subclass Moose::Meta::Attribute (or better,
install a trait via a role - as described in
Moose::Cookbook::Meta::Recipe1-5) which modified the behaviour of
get_value() and set_value().

Alternatively, depending on what you're doing (I only briefly skimmed the
earlier part of this thread) you could use Moose::Exporter to make a sugar
method which wraps 'has' (I think there are recipes for this as well but I
don't find them on a quick look).

BTW, snottiness won't help. It seems like you were suggesting doing
something that was not so much unconventional ("deviating from the One True
Way"), but rather it was going to lead to a lot of headaches (and
breakages) down the line. Listen to the wisdom of those who know the guts
of this stuff!


-- 
                 "Non-cooperation with evil is as much a duty
                  as cooperation with good." - Mahatma Gandhi
            .             .            .            .             .
Karen Etheridge, ka...@etheridge.ca       GCS C+++$ USL+++$ P+++$ w--- M++
http://etheridge.ca/                      PS++ PE-- b++ DI++++ e++ h(-)

Reply via email to