sub has_attribute { exists $_[0]->{attributes}->{$_[1]} }
sub get_attribute { $_[0]->{attributes}->{$_[1]} }
-sub get_attribute_list{ keys %{$_[0]->{attributes}} }
sub remove_attribute { delete $_[0]->{attributes}->{$_[1]} }
+sub get_attribute_list{ keys %{$_[0]->{attributes}} }
+
+
# XXX: for backward compatibility
my %foreign = map{ $_ => undef } qw(
Mouse Mouse::Role Mouse::Util Mouse::Util::TypeConstraints
SV* mouse_namespace;
SV* mouse_methods;
SV* mouse_name;
+SV* mouse_get_attribute;
+SV* mouse_get_attribute_list;
-static SV* mouse_all_attrs_cache;
-static SV* mouse_all_attrs_cache_gen;
#define MOUSE_xc_gen(a) MOUSE_av_at((a), MOUSE_XC_GEN)
#define MOUSE_xc_attrall(a) ( (AV*)MOUSE_av_at((a), MOUSE_XC_ATTRALL) )
XPUSHs(metaclass);
PUTBACK;
- n = call_method("get_attribute_list", G_ARRAY);
+ n = call_sv(mouse_get_attribute_list, G_ARRAY | G_METHOD);
for(NOOP; n > 0; n--){
SV* name;
}
(void)hv_store_ent(seen, name, &PL_sv_undef, 0U);
- av_push(attrall, newSVsv( mcall1s(metaclass, "get_attribute", name) ));
+ av_push(attrall, newSVsv( mcall1(metaclass, mouse_get_attribute, name) ));
}
}
av_store(xc, MOUSE_XC_DEMOLISHALL, (SV*)demolishall);
for(i = 0; i < len; i++){
- SV* const klass = MOUSE_av_at(linearized_isa, i);
+ SV* const klass = MOUSE_av_at(linearized_isa, i);
SV* meta;
GV* gv;
mouse_methods = newSVpvs_share("methods");
mouse_name = newSVpvs_share("name");
- mouse_all_attrs_cache = newSVpvs_share("__all_attrs_cache");
- mouse_all_attrs_cache_gen = newSVpvs_share("__all_attrs_cache_gen");
+ mouse_get_attribute = newSVpvs_share("get_attribute");
+ mouse_get_attribute_list = newSVpvs_share("get_attribute_list");
MOUSE_CALL_BOOT(Mouse__Util);
MOUSE_CALL_BOOT(Mouse__Util__TypeConstraints);