tweaking the attribute initializer stuff a little
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index 8ca431d..be88dc7 100644 (file)
@@ -14,7 +14,7 @@ use Class::MOP::Method;
 use Class::MOP::Immutable;
 
 BEGIN {
-    our $VERSION   = '0.51';
+    our $VERSION   = '0.53';
     our $AUTHORITY = 'cpan:STEVAN';    
     
     use XSLoader;
@@ -135,9 +135,7 @@ Class::MOP::Package->meta->add_attribute(
             # rather than re-produce it here
             'namespace' => \&Class::MOP::Package::namespace
         },
-        # NOTE:
-        # protect this from silliness
-        init_arg => '!............( DO NOT DO THIS )............!',
+        init_arg => undef,
         default  => sub { \undef }
     ))
 );
@@ -172,9 +170,7 @@ Class::MOP::Module->meta->add_attribute(
             # rather than re-produce it here
             'version' => \&Class::MOP::Module::version
         },
-        # NOTE:
-        # protect this from silliness
-        init_arg => '!............( DO NOT DO THIS )............!',
+        init_arg => undef,
         default  => sub { \undef }
     ))
 );
@@ -193,9 +189,7 @@ Class::MOP::Module->meta->add_attribute(
             # rather than re-produce it here
             'authority' => \&Class::MOP::Module::authority
         },
-        # NOTE:
-        # protect this from silliness
-        init_arg => '!............( DO NOT DO THIS )............!',
+        init_arg => undef,
         default  => sub { \undef }
     ))
 );
@@ -240,9 +234,7 @@ Class::MOP::Class->meta->add_attribute(
             # rather than re-produce it here
             'superclasses' => \&Class::MOP::Class::superclasses
         },
-        # NOTE:
-        # protect this from silliness
-        init_arg => '!............( DO NOT DO THIS )............!',
+        init_arg => undef,
         default  => sub { \undef }
     ))
 );
@@ -345,6 +337,14 @@ Class::MOP::Attribute->meta->add_attribute(
 );
 
 Class::MOP::Attribute->meta->add_attribute(
+    Class::MOP::Attribute->new('$!initializer' => (
+        init_arg  => 'initializer',
+        reader    => { 'initializer'     => \&Class::MOP::Attribute::initializer     },
+        predicate => { 'has_initializer' => \&Class::MOP::Attribute::has_initializer },
+    ))
+);
+
+Class::MOP::Attribute->meta->add_attribute(
     Class::MOP::Attribute->new('$!writer' => (
         init_arg  => 'writer',
         reader    => { 'writer'     => \&Class::MOP::Attribute::writer     },