remove Perl 6 attribute naming style
Yuval Kogman [Fri, 8 Aug 2008 22:13:45 +0000 (22:13 +0000)]
lib/Moose/Meta/Class.pm
lib/Moose/Meta/Method/Constructor.pm
lib/Moose/Meta/Method/Destructor.pm

index c183dc3..93b37ee 100644 (file)
@@ -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;
index 862125d..2cd22e2 100644 (file)
@@ -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 {
index 1f3b895..679db0e 100644 (file)
@@ -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;
 }