From: Stevan Little Date: Fri, 15 Sep 2006 20:34:52 +0000 (+0000) Subject: cleaning up Changes and docs X-Git-Tag: 0_35~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=864826055ffa48aba41ba1a016c09f24b51e85c4;p=gitmo%2FClass-MOP.git cleaning up Changes and docs --- diff --git a/Changes b/Changes index 6f163f0..405872f 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ Revision history for Perl extension Class-MOP. - added Class::MOP::Method (and its subclasses) to the bootstrap - adjusted tests for this + - added the Class::MOP::Instance attributes + to the bootstrap - bootstrap no longer re-compiles accessors so as to keep the MOP compile-time fast @@ -17,6 +19,7 @@ Revision history for Perl extension Class-MOP. - methods are no longer blessed CODE refs but are actual objects which can be CODE-ified - adjusted tests to compensate + - adjusted docs for this * Class::MOP::Class - changed how methods are dealt with to @@ -28,6 +31,7 @@ Revision history for Perl extension Class-MOP. a duplicate name, and properly removes the old one before installing the new one - added tests for this + - adjusted docs for this * Class::MOP::Class::Immutable - added caching of &get_method_map diff --git a/lib/Class/MOP.pm b/lib/Class/MOP.pm index 71656f9..e0f32e8 100644 --- a/lib/Class/MOP.pm +++ b/lib/Class/MOP.pm @@ -357,6 +357,21 @@ Class::MOP::Method::Wrapped->meta->add_attribute( ); ## -------------------------------------------------------- +## Class::MOP::Instance + +# NOTE: +# these don't yet do much of anything, but are just +# included for completeness + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('meta') +); + +Class::MOP::Instance->meta->add_attribute( + Class::MOP::Attribute->new('slots') +); + +## -------------------------------------------------------- ## Now close all the Class::MOP::* classes # NOTE: @@ -373,9 +388,11 @@ $_->meta->make_immutable( Class::MOP::Package Class::MOP::Module Class::MOP::Class + Class::MOP::Attribute Class::MOP::Method Class::MOP::Instance + Class::MOP::Object Class::MOP::Attribute::Accessor diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index ea560ba..6902284 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -1009,8 +1009,11 @@ C<$method_name> is actually a method. However, it will DWIM about =item B -This will return a CODE reference of the specified C<$method_name>, -or return undef if that method does not exist. +This will return a Class::MOP::Method instance related to the specified +C<$method_name>, or return undef if that method does not exist. + +The Class::MOP::Method is codifiable, so you can use it like a normal +CODE reference, see L for more information. =item B @@ -1188,6 +1191,11 @@ It should be noted that any accessor, reader/writer or predicate methods which the C<$attribute_meta_object> has will be installed into the class at this time. +B +If an attribute already exists for C<$attribute_name>, the old one +will be removed (as well as removing all it's accessors), and then +the new one added. + =item B Checks to see if this class has an attribute by the name of diff --git a/lib/Class/MOP/Method.pm b/lib/Class/MOP/Method.pm index 04f1312..06123a6 100644 --- a/lib/Class/MOP/Method.pm +++ b/lib/Class/MOP/Method.pm @@ -223,12 +223,11 @@ Class::MOP::Method - Method Meta Object =head1 DESCRIPTION The Method Protocol is very small, since methods in Perl 5 are just -subroutines within the particular package. Basically all we do is to -bless the subroutine. +subroutines within the particular package. We provide a very basic +introspection interface. -Currently this package is largely unused. Future plans are to provide -some very simple introspection methods for the methods themselves. -Suggestions for this are welcome. +This also contains the Class::MOP::Method::Wrapped subclass, which +provides the features for before, after and around method modifiers. =head1 METHODS @@ -249,8 +248,6 @@ to this class. =item B -This simply blesses the C<&code> reference passed to it. - =back =head2 Informational @@ -275,8 +272,6 @@ This simply blesses the C<&code> reference passed to it. =item B -This simply blesses the C<&code> reference passed to it. - =item B =back