From: Yuval Kogman Date: Fri, 8 Aug 2008 22:13:45 +0000 (+0000) Subject: remove Perl 6 attribute naming style X-Git-Tag: 0_55_01~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0d1c8e5596d451d35d214185f5ba4db0163d0367;p=gitmo%2FMoose.git remove Perl 6 attribute naming style --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index c183dc3..93b37ee 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -169,12 +169,12 @@ sub construct_instance { sub get_method_map { my $self = shift; - if (defined $self->{'$!_package_cache_flag'} && - $self->{'$!_package_cache_flag'} == Class::MOP::check_package_cache_flag($self->meta->name)) { - return $self->{'%!methods'}; + if (defined $self->{'_package_cache_flag'} && + $self->{'_package_cache_flag'} == Class::MOP::check_package_cache_flag($self->meta->name)) { + return $self->{'methods'}; } - my $map = $self->{'%!methods'}; + my $map = $self->{'methods'}; my $class_name = $self->name; my $method_metaclass = $self->method_metaclass; diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 862125d..2cd22e2 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -25,21 +25,21 @@ sub new { my $self = bless { # from our superclass - '&!body' => undef, - '$!package_name' => $options{package_name}, - '$!name' => $options{name}, + 'body' => undef, + 'package_name' => $options{package_name}, + 'name' => $options{name}, # specific to this subclass - '%!options' => $options{options}, - '$!meta_instance' => $options{metaclass}->get_meta_instance, - '@!attributes' => [ $options{metaclass}->compute_all_applicable_attributes ], + 'options' => $options{options}, + 'meta_instance' => $options{metaclass}->get_meta_instance, + 'attributes' => [ $options{metaclass}->compute_all_applicable_attributes ], # ... - '$!associated_metaclass' => $options{metaclass}, + 'associated_metaclass' => $options{metaclass}, } => $class; # we don't want this creating # a cycle in the code, if not # needed - weaken($self->{'$!associated_metaclass'}); + weaken($self->{'associated_metaclass'}); $self->initialize_body; @@ -48,11 +48,11 @@ sub new { ## accessors -sub options { (shift)->{'%!options'} } -sub meta_instance { (shift)->{'$!meta_instance'} } -sub attributes { (shift)->{'@!attributes'} } +sub options { (shift)->{'options'} } +sub meta_instance { (shift)->{'meta_instance'} } +sub attributes { (shift)->{'attributes'} } -sub associated_metaclass { (shift)->{'$!associated_metaclass'} } +sub associated_metaclass { (shift)->{'associated_metaclass'} } ## method @@ -117,7 +117,7 @@ sub initialize_body { $code = eval $source; confess "Could not eval the constructor :\n\n$source\n\nbecause :\n\n$@" if $@; } - $self->{'&!body'} = $code; + $self->{'body'} = $code; } sub _generate_BUILDARGS { diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index 1f3b895..679db0e 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -25,18 +25,18 @@ sub new { my $self = bless { # from our superclass - '&!body' => undef, - '$!package_name' => $options{package_name}, - '$!name' => $options{name}, + 'body' => undef, + 'package_name' => $options{package_name}, + 'name' => $options{name}, # ... - '%!options' => $options{options}, - '$!associated_metaclass' => $options{metaclass}, + 'options' => $options{options}, + 'associated_metaclass' => $options{metaclass}, } => $class; # we don't want this creating # a cycle in the code, if not # needed - weaken($self->{'$!associated_metaclass'}); + weaken($self->{'associated_metaclass'}); $self->initialize_body; @@ -45,8 +45,8 @@ sub new { ## accessors -sub options { (shift)->{'%!options'} } -sub associated_metaclass { (shift)->{'$!associated_metaclass'} } +sub options { (shift)->{'options'} } +sub associated_metaclass { (shift)->{'associated_metaclass'} } ## method @@ -59,7 +59,7 @@ sub is_needed { || confess "When calling is_needed as a class method you must pass a class name"; return $_[0]->meta->can('DEMOLISH'); } - defined $self->{'&!body'} ? 1 : 0 + defined $self->{'body'} ? 1 : 0 } sub initialize_body { @@ -93,7 +93,7 @@ sub initialize_body { $code = eval $source; confess "Could not eval the destructor :\n\n$source\n\nbecause :\n\n$@" if $@; } - $self->{'&!body'} = $code; + $self->{'body'} = $code; }