On Mar 29, 2009, at 3:59 PM, Hans Dieter Pearcey wrote:
On Sun, Mar 29, 2009 at 11:40:43AM -0400, Stevan Little wrote:
Personally, I don't think we need to pass that meta-attribute, if you
really want/need it, then you can do this:
trigger => sub {
my $self = shift;
$self->meta->find_attribute_by_name('foo')->...
...
}
The only tricky part of the above workaround is that you need to know
the name of the attribute in order to get the meta-attribute. But
this
shouldn't be too hard to fix/work-around in most cases.
What about passing in the attribute name instead of the meta-
attribute? Then
there's no trickery necessary at all. Or a coderef that wraps up
getting the
necessary objects:
sub { Moose::Util::find_meta($class_name)-
>get_attribute($attr_name) }
which requires closing over no objects.
Those all work, but they just make things more confusing I think.
If we want to keep it, lets keep it, but if we don't really have a
reason, lets just get rid of it.
- Stevan