From: Stevan Little Date: Wed, 5 Jul 2006 22:04:38 +0000 (+0000) Subject: foo X-Git-Tag: 0_33~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=be960ba18045b2874c9151ff9e0006fc9ede1ced;p=gitmo%2FClass-MOP.git foo --- diff --git a/Changes b/Changes index effc065..8f3266a 100644 --- a/Changes +++ b/Changes @@ -6,6 +6,10 @@ Revision history for Perl extension Class-MOP. created the Class::MOP::Package and Class::MOP::Module classes to more closely conform to Perl 6's meta model + + created Class::MOP::Class::Immutable + which can be used to "close" a class + and then apply some optimizations * Class::MOP::Class - now inherits from Class::MOP::Module @@ -23,6 +27,9 @@ Revision history for Perl extension Class-MOP. * Class::MOP::Instance - added an is_inlinable method to allow other classes to check before they attempt to optimize. + - added an inline_create_instance to inline + instance creation (of course) + 0.29_02 Thurs. June 22, 2006 ++ DEVELOPER RELEASE ++ diff --git a/lib/Class/MOP/Attribute.pm b/lib/Class/MOP/Attribute.pm index 5352826..85480f1 100644 --- a/lib/Class/MOP/Attribute.pm +++ b/lib/Class/MOP/Attribute.pm @@ -7,7 +7,7 @@ use warnings; use Carp 'confess'; use Scalar::Util 'blessed', 'reftype', 'weaken'; -our $VERSION = '0.08'; +our $VERSION = '0.09'; sub meta { require Class::MOP::Class; diff --git a/lib/Class/MOP/Class/Immutable.pm b/lib/Class/MOP/Class/Immutable.pm index bbe5429..172b0b4 100644 --- a/lib/Class/MOP/Class/Immutable.pm +++ b/lib/Class/MOP/Class/Immutable.pm @@ -148,6 +148,25 @@ Class::MOP::Class::Immutable - An immutable version of Class::MOP::Class =head1 SYNOPSIS + package Point; + use metaclass; + + __PACKAGE__->meta->add_attribute('x' => (accessor => 'x', default => 10)); + __PACKAGE__->meta->add_attribute('y' => (accessor => 'y')); + + sub new { + my $class = shift; + $class->meta->new_object(@_); + } + + sub clear { + my $self = shift; + $self->x(0); + $self->y(0); + } + + __PACKAGE__->meta->make_immutable(); # close the class + =head1 DESCRIPTION Class::MOP offers many benefits to object oriented development but it @@ -183,6 +202,9 @@ to this class. =item B +The arguments to C are passed +to this method, which + =over 4 =item I diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 4f56213..c9a2ca4 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -6,7 +6,7 @@ use warnings; use Scalar::Util 'weaken', 'blessed'; -our $VERSION = '0.01'; +our $VERSION = '0.02'; sub meta { require Class::MOP::Class; diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm index e2ca21d..d005efe 100644 --- a/lib/Class/MOP/Method.pm +++ b/lib/Class/MOP/Method.pm @@ -8,7 +8,7 @@ use Carp 'confess'; use Scalar::Util 'reftype', 'blessed'; use B 'svref_2object'; -our $VERSION = '0.02'; +our $VERSION = '0.03'; # introspection