return *{$package . '::' . $name}{CODE};
}
-sub _generate_isa_predicate_for {
+sub generate_isa_predicate_for {
my($for_class, $name) = @_;
my $predicate = sub{ Scalar::Util::blessed($_[0]) && $_[0]->isa($for_class) };
*get_all_metaclass_names = \&Mouse::Meta::Module::get_all_metaclass_names;
# is-a predicates
- _generate_isa_predicate_for('Mouse::Meta::TypeConstraint' => 'is_a_type_constraint');
- _generate_isa_predicate_for('Mouse::Meta::Class' => 'is_a_metaclass');
- _generate_isa_predicate_for('Mouse::Meta::Role' => 'is_a_metarole');
+ generate_isa_predicate_for('Mouse::Meta::TypeConstraint' => 'is_a_type_constraint');
+ generate_isa_predicate_for('Mouse::Meta::Class' => 'is_a_metaclass');
+ generate_isa_predicate_for('Mouse::Meta::Role' => 'is_a_metarole');
}
my $class = $options->{class} || $name;
return _create_type 'subtype', $name => (
as => 'Object',
- optimized_as => Mouse::Util::_generate_isa_predicate_for($class),
+ optimized_as => Mouse::Util::generate_isa_predicate_for($class),
type => 'Class',
);
RETVAL
void
-_generate_isa_predicate_for(SV* klass, const char* predicate_name = NULL)
+generate_isa_predicate_for(SV* klass, const char* predicate_name = NULL)
PPCODE:
{
STRLEN klass_len;
#define MG_klass_pv(mg) ((mg)->mg_ptr)
#define MG_klass_len(mg) ((mg)->mg_len)
-static MGVTBL mouse_util_type_constraints_vtbl;
-
const char*
mouse_canonicalize_package_name(const char* name){