Mouse internal cache must be started with '_mouse_cache'
[gitmo/Mouse.git] / lib / Mouse / PurePerl.pm
CommitLineData
ccb38d0b 1package Mouse::PurePerl;
4bef84ef 2# The pure Perl backend for Mouse
6fffa617 3package Mouse::Util;
df6dd016 4use strict;
5use warnings;
4bef84ef 6use warnings FATAL => 'redefine'; # to avoid to load Mouse::PurePerl twice
df6dd016 7
8use B ();
9
4bef84ef 10require Mouse::Util;
11
0ffc4183 12
13# taken from Class/MOP.pm
14sub is_valid_class_name {
15 my $class = shift;
16
17 return 0 if ref($class);
18 return 0 unless defined($class);
19
20 return 1 if $class =~ /\A \w+ (?: :: \w+ )* \z/xms;
21
22 return 0;
23}
24
df6dd016 25sub is_class_loaded {
26 my $class = shift;
27
28 return 0 if ref($class) || !defined($class) || !length($class);
29
30 # walk the symbol table tree to avoid autovififying
3bb9e54e 31 # \*{${main::}{"Foo::"}{"Bar::"}} == \*main::Foo::Bar::
df6dd016 32
33 my $pack = \%::;
34 foreach my $part (split('::', $class)) {
3bb9e54e 35 $part .= '::';
36 return 0 if !exists $pack->{$part};
37
38 my $entry = \$pack->{$part};
df6dd016 39 return 0 if ref($entry) ne 'GLOB';
3bb9e54e 40 $pack = *{$entry}{HASH};
df6dd016 41 }
42
3bb9e54e 43 return 0 if !%{$pack};
44
df6dd016 45 # check for $VERSION or @ISA
46 return 1 if exists $pack->{VERSION}
47 && defined *{$pack->{VERSION}}{SCALAR} && defined ${ $pack->{VERSION} };
48 return 1 if exists $pack->{ISA}
49 && defined *{$pack->{ISA}}{ARRAY} && @{ $pack->{ISA} } != 0;
50
51 # check for any method
52 foreach my $name( keys %{$pack} ) {
53 my $entry = \$pack->{$name};
54 return 1 if ref($entry) ne 'GLOB' || defined *{$entry}{CODE};
55 }
56
57 # fail
58 return 0;
59}
60
61
62# taken from Sub::Identify
63sub get_code_info {
64 my ($coderef) = @_;
65 ref($coderef) or return;
66
67 my $cv = B::svref_2object($coderef);
68 $cv->isa('B::CV') or return;
69
70 my $gv = $cv->GV;
71 $gv->isa('B::GV') or return;
72
73 return ($gv->STASH->NAME, $gv->NAME);
74}
75
76sub get_code_package{
77 my($coderef) = @_;
78
79 my $cv = B::svref_2object($coderef);
80 $cv->isa('B::CV') or return '';
81
82 my $gv = $cv->GV;
83 $gv->isa('B::GV') or return '';
84
85 return $gv->STASH->NAME;
86}
87
7d96ae4d 88sub get_code_ref{
89 my($package, $name) = @_;
90 no strict 'refs';
91 no warnings 'once';
92 use warnings FATAL => 'uninitialized';
93 return *{$package . '::' . $name}{CODE};
94}
95
e3540312 96sub generate_isa_predicate_for {
1d5ecd5f 97 my($for_class, $name) = @_;
98
f48920c1 99 my $predicate = sub{ Scalar::Util::blessed($_[0]) && $_[0]->isa($for_class) };
1d5ecd5f 100
101 if(defined $name){
1194aede 102 Mouse::Util::install_subroutines(scalar caller, $name => $predicate);
1d5ecd5f 103 return;
104 }
105
106 return $predicate;
107}
108
ebe91068 109sub generate_can_predicate_for {
110 my($methods_ref, $name) = @_;
111
112 my @methods = @{$methods_ref};
113
114 my $predicate = sub{
115 my($instance) = @_;
116 if(Scalar::Util::blessed($instance)){
117 foreach my $method(@methods){
118 if(!$instance->can($method)){
119 return 0;
120 }
121 }
122 return 1;
123 }
124 return 0;
125 };
126
127 if(defined $name){
1194aede 128 Mouse::Util::install_subroutines(scalar caller, $name => $predicate);
ebe91068 129 return;
130 }
131
132 return $predicate;
133}
1d5ecd5f 134
6fffa617 135package Mouse::Util::TypeConstraints;
f48920c1 136
137use Scalar::Util qw(blessed looks_like_number openhandle);
138
7d96ae4d 139sub Any { 1 }
140sub Item { 1 }
7d96ae4d 141
142sub Bool { $_[0] ? $_[0] eq '1' : 1 }
143sub Undef { !defined($_[0]) }
144sub Defined { defined($_[0]) }
145sub Value { defined($_[0]) && !ref($_[0]) }
1adf864e 146sub Num { looks_like_number($_[0]) }
9848d3e1 147sub Str {
4b58033d 148 # We need to use a copy here to flatten MAGICs, for instance as in
149 # Str( substr($_, 0, 42) ).
9848d3e1 150 my($value) = @_;
151 return defined($value) && ref(\$value) eq 'SCALAR';
152}
4b58033d 153sub Int {
154 # We need to use a copy here to save the original internal SV flags.
155 my($value) = @_;
156 return defined($value) && $value =~ /\A -? [0-9]+ \z/xms;
157}
7d96ae4d 158
159sub Ref { ref($_[0]) }
9848d3e1 160sub ScalarRef {
161 my($value) = @_;
4068a8f6 162 return ref($value) eq 'SCALAR' || ref($value) eq 'REF';
9848d3e1 163}
7d96ae4d 164sub ArrayRef { ref($_[0]) eq 'ARRAY' }
165sub HashRef { ref($_[0]) eq 'HASH' }
166sub CodeRef { ref($_[0]) eq 'CODE' }
167sub RegexpRef { ref($_[0]) eq 'Regexp' }
168sub GlobRef { ref($_[0]) eq 'GLOB' }
169
170sub FileHandle {
9848d3e1 171 return openhandle($_[0]) || (blessed($_[0]) && $_[0]->isa("IO::Handle"))
7d96ae4d 172}
173
174sub Object { blessed($_[0]) && blessed($_[0]) ne 'Regexp' }
175
176sub ClassName { Mouse::Util::is_class_loaded($_[0]) }
177sub RoleName { (Mouse::Util::class_of($_[0]) || return 0)->isa('Mouse::Meta::Role') }
178
619338ac 179sub _parameterize_ArrayRef_for {
180 my($type_parameter) = @_;
181 my $check = $type_parameter->_compiled_type_constraint;
182
183 return sub {
184 foreach my $value (@{$_}) {
185 return undef unless $check->($value);
186 }
187 return 1;
188 }
189}
190
191sub _parameterize_HashRef_for {
192 my($type_parameter) = @_;
193 my $check = $type_parameter->_compiled_type_constraint;
194
195 return sub {
196 foreach my $value(values %{$_}){
197 return undef unless $check->($value);
198 }
199 return 1;
200 };
201}
202
203# 'Maybe' type accepts 'Any', so it requires parameters
204sub _parameterize_Maybe_for {
205 my($type_parameter) = @_;
206 my $check = $type_parameter->_compiled_type_constraint;
207
208 return sub{
209 return !defined($_) || $check->($_);
210 };
9b923ac8 211}
7d96ae4d 212
6fffa617 213package Mouse::Meta::Module;
43165725 214
926404f2 215sub name { $_[0]->{package} }
216
217sub _method_map { $_[0]->{methods} }
c5f6ad05 218sub _attribute_map{ $_[0]->{attributes} }
43165725 219
2591e962 220sub namespace{
221 my $name = $_[0]->{package};
222 no strict 'refs';
223 return \%{ $name . '::' };
224}
225
3e44140b 226sub add_method {
227 my($self, $name, $code) = @_;
228
229 if(!defined $name){
230 $self->throw_error('You must pass a defined name');
231 }
232 if(!defined $code){
233 $self->throw_error('You must pass a defined code');
234 }
235
236 if(ref($code) ne 'CODE'){
237 $code = \&{$code}; # coerce
238 }
239
240 $self->{methods}->{$name} = $code; # Moose stores meta object here.
241
1194aede 242 Mouse::Util::install_subroutines($self->name,
243 $name => $code,
244 );
3e44140b 245 return;
246}
247
b4dc9315 248my $generate_class_accessor = sub {
249 my($name) = @_;
250 return sub {
251 my $self = shift;
252 if(@_) {
253 return $self->{$name} = shift;
254 }
255
256 foreach my $class($self->linearized_isa) {
257 my $meta = Mouse::Util::get_metaclass_by_name($class)
258 or next;
259
260 if(exists $meta->{$name}) {
261 return $meta->{$name};
262 }
263 }
264 return undef;
265 };
266};
267
268
6fffa617 269package Mouse::Meta::Class;
43165725 270
e088c5fc 271use Mouse::Meta::Method::Constructor;
272use Mouse::Meta::Method::Destructor;
273
e058b279 274sub method_metaclass { $_[0]->{method_metaclass} || 'Mouse::Meta::Method' }
275sub attribute_metaclass { $_[0]->{attribute_metaclass} || 'Mouse::Meta::Attribute' }
276
277sub constructor_class { $_[0]->{constructor_class} || 'Mouse::Meta::Method::Constructor' }
278sub destructor_class { $_[0]->{destructor_class} || 'Mouse::Meta::Method::Destructor' }
4e7e3250 279
43165725 280sub is_anon_class{
281 return exists $_[0]->{anon_serial_id};
282}
283
284sub roles { $_[0]->{roles} }
285
bc76ed1c 286sub linearized_isa { @{ Mouse::Util::get_linear_isa($_[0]->{package}) } }
cccb83de 287
ba153b33 288sub new_object {
b5956f03 289 my $meta = shift;
ba153b33 290 my %args = (@_ == 1 ? %{$_[0]} : @_);
291
b5956f03 292 my $object = bless {}, $meta->name;
ba153b33 293
a3a09e38 294 $meta->_initialize_object($object, \%args, 0);
b5956f03 295 # BUILDALL
296 if( $object->can('BUILD') ) {
297 for my $class (reverse $meta->linearized_isa) {
298 my $build = Mouse::Util::get_code_ref($class, 'BUILD')
299 || next;
300
301 $object->$build(\%args);
302 }
303 }
ba153b33 304 return $object;
305}
306
13b99908 307sub clone_object {
308 my $class = shift;
309 my $object = shift;
310 my $args = $object->Mouse::Object::BUILDARGS(@_);
311
312 (blessed($object) && $object->isa($class->name))
313 || $class->throw_error("You must pass an instance of the metaclass (" . $class->name . "), not ($object)");
314
315 my $cloned = bless { %$object }, ref $object;
316 $class->_initialize_object($cloned, $args, 1);
13b99908 317 return $cloned;
318}
319
4e7e3250 320sub _initialize_object{
cb6a9721 321 my($self, $object, $args, $is_cloning) = @_;
74de0f8b 322 # The initializer, which is used everywhere, must be clear
323 # when an attribute is added. See Mouse::Meta::Class::add_attribute.
abbcd124 324 my $initializer = $self->{_mouse_cache}{_initialize_object} ||=
a3a09e38 325 Mouse::Util::load_class($self->constructor_class)
326 ->_generate_initialize_object($self);
a3a09e38 327 goto &{$initializer};
4e7e3250 328}
329
abbcd124 330sub get_all_attributes {
331 my($self) = @_;
332 return @{ $self->{_mouse_cache}{all_attributes}
333 ||= $self->_calculate_all_attributes };
334}
335
80efe911 336sub is_immutable { $_[0]->{is_immutable} }
4e7e3250 337
823419c5 338sub strict_constructor;
339*strict_constructor = $generate_class_accessor->('strict_constructor');
fb4ddd88 340
341sub _report_unknown_args {
342 my($metaclass, $attrs, $args) = @_;
343
344 my @unknowns;
345 my %init_args;
346 foreach my $attr(@{$attrs}){
347 my $init_arg = $attr->init_arg;
348 if(defined $init_arg){
349 $init_args{$init_arg}++;
350 }
351 }
352
353 while(my $key = each %{$args}){
354 if(!exists $init_args{$key}){
355 push @unknowns, $key;
356 }
357 }
358
359 $metaclass->throw_error( sprintf
360 "Unknown attribute passed to the constructor of %s: %s",
361 $metaclass->name, Mouse::Util::english_list(@unknowns),
362 );
363}
e128626c 364
6fffa617 365package Mouse::Meta::Role;
43165725 366
e058b279 367sub method_metaclass{ $_[0]->{method_metaclass} || 'Mouse::Meta::Role::Method' }
368
43165725 369sub is_anon_role{
370 return exists $_[0]->{anon_serial_id};
371}
372
373sub get_roles { $_[0]->{roles} }
374
cb60d0b5 375sub add_before_method_modifier {
376 my ($self, $method_name, $method) = @_;
377
378 push @{ $self->{before_method_modifiers}{$method_name} ||= [] }, $method;
379 return;
380}
381sub add_around_method_modifier {
382 my ($self, $method_name, $method) = @_;
383
384 push @{ $self->{around_method_modifiers}{$method_name} ||= [] }, $method;
385 return;
386}
387sub add_after_method_modifier {
388 my ($self, $method_name, $method) = @_;
389
390 push @{ $self->{after_method_modifiers}{$method_name} ||= [] }, $method;
391 return;
392}
393
394sub get_before_method_modifiers {
395 my ($self, $method_name) = @_;
396 return @{ $self->{before_method_modifiers}{$method_name} ||= [] }
397}
398sub get_around_method_modifiers {
399 my ($self, $method_name) = @_;
400 return @{ $self->{around_method_modifiers}{$method_name} ||= [] }
401}
402sub get_after_method_modifiers {
403 my ($self, $method_name) = @_;
404 return @{ $self->{after_method_modifiers}{$method_name} ||= [] }
405}
406
b4dc9315 407sub add_metaclass_accessor { # for meta roles (a.k.a. traits)
408 my($meta, $name) = @_;
409 $meta->add_method($name => $generate_class_accessor->($name));
410 return;
411}
412
6fffa617 413package Mouse::Meta::Attribute;
43165725 414
e058b279 415require Mouse::Meta::Method::Accessor;
416
417sub accessor_metaclass{ $_[0]->{accessor_metaclass} || 'Mouse::Meta::Method::Accessor' }
43165725 418
419# readers
420
421sub name { $_[0]->{name} }
422sub associated_class { $_[0]->{associated_class} }
423
424sub accessor { $_[0]->{accessor} }
425sub reader { $_[0]->{reader} }
426sub writer { $_[0]->{writer} }
427sub predicate { $_[0]->{predicate} }
428sub clearer { $_[0]->{clearer} }
429sub handles { $_[0]->{handles} }
430
431sub _is_metadata { $_[0]->{is} }
432sub is_required { $_[0]->{required} }
433sub default { $_[0]->{default} }
434sub is_lazy { $_[0]->{lazy} }
435sub is_lazy_build { $_[0]->{lazy_build} }
436sub is_weak_ref { $_[0]->{weak_ref} }
437sub init_arg { $_[0]->{init_arg} }
438sub type_constraint { $_[0]->{type_constraint} }
439
440sub trigger { $_[0]->{trigger} }
441sub builder { $_[0]->{builder} }
442sub should_auto_deref { $_[0]->{auto_deref} }
443sub should_coerce { $_[0]->{coerce} }
444
d899d3e7 445sub documentation { $_[0]->{documentation} }
beb51b30 446sub insertion_order { $_[0]->{insertion_order} }
d899d3e7 447
43165725 448# predicates
449
450sub has_accessor { exists $_[0]->{accessor} }
451sub has_reader { exists $_[0]->{reader} }
452sub has_writer { exists $_[0]->{writer} }
453sub has_predicate { exists $_[0]->{predicate} }
454sub has_clearer { exists $_[0]->{clearer} }
455sub has_handles { exists $_[0]->{handles} }
456
457sub has_default { exists $_[0]->{default} }
458sub has_type_constraint { exists $_[0]->{type_constraint} }
459sub has_trigger { exists $_[0]->{trigger} }
460sub has_builder { exists $_[0]->{builder} }
461
d899d3e7 462sub has_documentation { exists $_[0]->{documentation} }
463
ba1f50a2 464sub _process_options{
465 my($class, $name, $args) = @_;
466
467 # taken from Class::MOP::Attribute::new
468
469 defined($name)
470 or $class->throw_error('You must provide a name for the attribute');
471
472 if(!exists $args->{init_arg}){
473 $args->{init_arg} = $name;
474 }
475
476 # 'required' requires eigher 'init_arg', 'builder', or 'default'
477 my $can_be_required = defined( $args->{init_arg} );
478
479 if(exists $args->{builder}){
480 # XXX:
481 # Moose refuses a CODE ref builder, but Mouse doesn't for backward compatibility
482 # This feature will be changed in a future. (gfx)
483 $class->throw_error('builder must be a defined scalar value which is a method name')
484 #if ref $args->{builder} || !defined $args->{builder};
485 if !defined $args->{builder};
486
487 $can_be_required++;
488 }
489 elsif(exists $args->{default}){
490 if(ref $args->{default} && ref($args->{default}) ne 'CODE'){
491 $class->throw_error("References are not allowed as default values, you must "
492 . "wrap the default of '$name' in a CODE reference (ex: sub { [] } and not [])");
493 }
494 $can_be_required++;
495 }
496
497 if( $args->{required} && !$can_be_required ) {
498 $class->throw_error("You cannot have a required attribute ($name) without a default, builder, or an init_arg");
499 }
500
501 # taken from Mouse::Meta::Attribute->new and ->_process_args
502
503 if(exists $args->{is}){
504 my $is = $args->{is};
505
506 if($is eq 'ro'){
507 $args->{reader} ||= $name;
508 }
509 elsif($is eq 'rw'){
510 if(exists $args->{writer}){
511 $args->{reader} ||= $name;
512 }
513 else{
514 $args->{accessor} ||= $name;
515 }
516 }
517 elsif($is eq 'bare'){
518 # do nothing, but don't complain (later) about missing methods
519 }
520 else{
521 $is = 'undef' if !defined $is;
522 $class->throw_error("I do not understand this option (is => $is) on attribute ($name)");
523 }
524 }
525
526 my $tc;
527 if(exists $args->{isa}){
d503a4f3 528 $tc = $args->{type_constraint} = Mouse::Util::TypeConstraints::find_or_create_isa_type_constraint($args->{isa});
ba1f50a2 529 }
d503a4f3 530
531 if(exists $args->{does}){
532 if(defined $tc){ # both isa and does supplied
533 my $does_ok = do{
534 local $@;
535 eval{ "$tc"->does($args) };
536 };
537 if(!$does_ok){
538 $class->throw_error("Cannot have both an isa option and a does option because '$tc' does not do '$args->{does}' on attribute ($name)");
539 }
540 }
541 else {
542 $tc = $args->{type_constraint} = Mouse::Util::TypeConstraints::find_or_create_does_type_constraint($args->{does});
543 }
ba1f50a2 544 }
ba1f50a2 545
546 if($args->{coerce}){
547 defined($tc)
548 || $class->throw_error("You cannot have coercion without specifying a type constraint on attribute ($name)");
549
550 $args->{weak_ref}
551 && $class->throw_error("You cannot have a weak reference to a coerced value on attribute ($name)");
552 }
553
554 if ($args->{lazy_build}) {
555 exists($args->{default})
556 && $class->throw_error("You can not use lazy_build and default for the same attribute ($name)");
557
558 $args->{lazy} = 1;
559 $args->{builder} ||= "_build_${name}";
560 if ($name =~ /^_/) {
561 $args->{clearer} ||= "_clear${name}";
562 $args->{predicate} ||= "_has${name}";
563 }
564 else {
565 $args->{clearer} ||= "clear_${name}";
566 $args->{predicate} ||= "has_${name}";
567 }
568 }
569
570 if ($args->{auto_deref}) {
571 defined($tc)
572 || $class->throw_error("You cannot auto-dereference without specifying a type constraint on attribute ($name)");
573
574 ( $tc->is_a_type_of('ArrayRef') || $tc->is_a_type_of('HashRef') )
575 || $class->throw_error("You cannot auto-dereference anything other than a ArrayRef or HashRef on attribute ($name)");
576 }
577
578 if (exists $args->{trigger}) {
579 ('CODE' eq ref $args->{trigger})
580 || $class->throw_error("Trigger must be a CODE ref on attribute ($name)");
581 }
582
583 if ($args->{lazy}) {
584 (exists $args->{default} || defined $args->{builder})
585 || $class->throw_error("You cannot have lazy attribute ($name) without specifying a default value for it");
586 }
587
588 return;
589}
590
591
6fffa617 592package Mouse::Meta::TypeConstraint;
43165725 593
6e647cac 594use overload
595 '""' => '_as_string',
b4dc9315 596 '0+' => '_identity',
6e647cac 597 '|' => '_unite',
598
599 fallback => 1;
600
43165725 601sub name { $_[0]->{name} }
602sub parent { $_[0]->{parent} }
603sub message { $_[0]->{message} }
604
f6c81f00 605sub _identity { Scalar::Util::refaddr($_[0]) } # overload 0+
606
72dc2c9d 607sub type_parameter { $_[0]->{type_parameter} }
43165725 608sub _compiled_type_constraint{ $_[0]->{compiled_type_constraint} }
93540011 609sub _compiled_type_coercion { $_[0]->{_compiled_type_coercion} }
df6dd016 610
72dc2c9d 611sub __is_parameterized { exists $_[0]->{type_parameter} }
612sub has_coercion { exists $_[0]->{_compiled_type_coercion} }
df6dd016 613
f790c46b 614
615sub compile_type_constraint{
616 my($self) = @_;
617
618 # add parents first
619 my @checks;
620 for(my $parent = $self->{parent}; defined $parent; $parent = $parent->{parent}){
621 if($parent->{hand_optimized_type_constraint}){
622 unshift @checks, $parent->{hand_optimized_type_constraint};
623 last; # a hand optimized constraint must include all the parents
624 }
625 elsif($parent->{constraint}){
626 unshift @checks, $parent->{constraint};
627 }
628 }
629
630 # then add child
631 if($self->{constraint}){
632 push @checks, $self->{constraint};
633 }
634
635 if($self->{type_constraints}){ # Union
636 my @types = map{ $_->{compiled_type_constraint} } @{ $self->{type_constraints} };
637 push @checks, sub{
638 foreach my $c(@types){
639 return 1 if $c->($_[0]);
640 }
641 return 0;
642 };
643 }
644
645 if(@checks == 0){
646 $self->{compiled_type_constraint} = \&Mouse::Util::TypeConstraints::Any;
647 }
648 else{
649 $self->{compiled_type_constraint} = sub{
650 my(@args) = @_;
651 local $_ = $args[0];
652 foreach my $c(@checks){
653 return undef if !$c->(@args);
654 }
655 return 1;
656 };
657 }
658 return;
659}
660
c7576321 661sub check {
662 my $self = shift;
663 return $self->_compiled_type_constraint->(@_);
664}
665
666
6fffa617 667package Mouse::Object;
aa2d2e2c 668
aa2d2e2c 669sub BUILDARGS {
670 my $class = shift;
f790c46b 671
aa2d2e2c 672 if (scalar @_ == 1) {
673 (ref($_[0]) eq 'HASH')
674 || $class->meta->throw_error("Single parameters to new() must be a HASH ref");
675
676 return {%{$_[0]}};
677 }
678 else {
679 return {@_};
680 }
681}
f790c46b 682
af04626d 683sub new {
684 my $class = shift;
c83feefa 685 my $args = $class->BUILDARGS(@_);
686 return $class->meta->new_object($args);
af04626d 687}
688
a5c683f6 689sub DESTROY {
690 my $self = shift;
691
692 return unless $self->can('DEMOLISH'); # short circuit
693
a5c683f6 694 my $e = do{
a3a09e38 695 local $?;
a5c683f6 696 local $@;
697 eval{
a5c683f6 698 # DEMOLISHALL
699
700 # We cannot count on being able to retrieve a previously made
701 # metaclass, _or_ being able to make a new one during global
702 # destruction. However, we should still be able to use mro at
703 # that time (at least tests suggest so ;)
704
705 foreach my $class (@{ Mouse::Util::get_linear_isa(ref $self) }) {
706 my $demolish = Mouse::Util::get_code_ref($class, 'DEMOLISH')
707 || next;
708
6514735e 709 $self->$demolish($Mouse::Util::in_global_destruction);
a5c683f6 710 }
711 };
712 $@;
713 };
714
715 no warnings 'misc';
716 die $e if $e; # rethrow
717}
718
adb5eb76 719sub BUILDALL {
720 my $self = shift;
721
722 # short circuit
723 return unless $self->can('BUILD');
724
725 for my $class (reverse $self->meta->linearized_isa) {
726 my $build = Mouse::Util::get_code_ref($class, 'BUILD')
727 || next;
728
729 $self->$build(@_);
730 }
731 return;
732}
733
734sub DEMOLISHALL;
735*DEMOLISHALL = \&DESTROY;
736
df6dd016 7371;
738__END__
ccb38d0b 739
740=head1 NAME
741
742Mouse::PurePerl - A Mouse guts in pure Perl
743
744=head1 VERSION
745
b0d52f03 746This document describes Mouse version 0.73
ccb38d0b 747
748=head1 SEE ALSO
749
750L<Mouse::XS>
751
752=cut