X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP.pm;h=be88dc7888a7f6332167ba029df0fcd082dee849;hb=8ee74136c5d5c5a6416844e7238898f47b00f553;hp=720a9b5bc7a5a1be793260093642a0017fa34b72;hpb=2a2b84587843665ec0c541f4635455f490480595;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 720a9b5..be88dc7 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -14,7 +14,7 @@ use Class::MOP::Method; use Class::MOP::Immutable; BEGIN { - our $VERSION = '0.52'; + 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 },