use Class::MOP::Class::Immutable;
-our $VERSION = '0.33';
+our $VERSION = '0.34';
our $AUTHORITY = 'cpan:STEVAN';
{
Class::MOP::Package->meta->add_attribute(
Class::MOP::Attribute->new('%:namespace' => (
reader => {
- 'namespace' => sub { (shift)->{'%:namespace'} }
- },
- default => sub {
- my ($class) = @_;
- no strict 'refs';
- return \%{$class->name . '::'};
+ # NOTE:
+ # because of issues with the Perl API
+ # to the typeglob in some versions, we
+ # need to just always grab a new
+ # reference to the hash here. Ideally
+ # we could just store a ref and it would
+ # Just Work, but oh well :\
+ 'namespace' => sub {
+ no strict 'refs';
+ \%{$_[0]->name . '::'}
+ }
},
# NOTE:
# protect this from silliness
init_arg => '!............( DO NOT DO THIS )............!',
+ default => sub { \undef }
))
);
# NOTE:
# protect this from silliness
init_arg => '!............( DO NOT DO THIS )............!',
+ default => sub { \undef }
))
);
# NOTE:
# protect this from silliness
init_arg => '!............( DO NOT DO THIS )............!',
+ default => sub { \undef }
))
);
);
Class::MOP::Class->meta->add_attribute(
+ Class::MOP::Attribute->new('%:methods' => (
+ #reader => 'get_method_map',
+ #reader => {
+ # # NOTE:
+ # # as with the $VERSION and $AUTHORITY above
+ # # sometimes we don't/can't store directly
+ # # inside the instance, so we need the accessor
+ # # to just DWIM
+ # 'get_method_map' => sub {
+ # my $self = shift;
+ # # FIXME:
+ # # there is a faster/better way
+ # # to do this, I am sure :)
+ # return +{
+ # map {
+ # $_ => $self->method_metaclass->wrap($self->get_package_symbol('&' . $_))
+ # } grep {
+ # $self->has_package_symbol('&' . $_)
+ # } $self->list_all_package_symbols
+ # };
+ # }
+ #},
+ #init_arg => '!............( DO NOT DO THIS )............!',
+ #default => sub { \undef }
+ default => sub { {} }
+ ))
+);
+
+Class::MOP::Class->meta->add_attribute(
Class::MOP::Attribute->new('$:attribute_metaclass' => (
reader => 'attribute_metaclass',
init_arg => ':attribute_metaclass',