upping verison numbers and reviewing the immutable changes
Stevan Little [Fri, 8 Jun 2007 20:16:18 +0000 (20:16 +0000)]
Changes
MANIFEST
README
lib/Class/MOP.pm
lib/Class/MOP/Class.pm
lib/Class/MOP/Immutable.pm

diff --git a/Changes b/Changes
index 4b4375f..91d79a5 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 Revision history for Perl extension Class-MOP.
+
 0.39 
-    * Class::MOP::Class::Immutable
+    * Class::MOP::Immutable
       - added make_metaclass_mutable + docs (groditi)
       - removed unused variable
       - added create_immutable_transformer
index 451add4..135deff 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -61,6 +61,7 @@ t/061_instance_inline.t
 t/070_immutable_metaclass.t
 t/071_immutable_w_custom_metaclass.t
 t/072_immutable_w_constructors.t
+t/073_make_mutable.t
 t/080_meta_package.t
 t/081_meta_package_extension.t
 t/100_BinaryTree_test.t
diff --git a/README b/README
index bdbb05e..46e9573 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Class::MOP version 0.38
+Class::MOP version 0.39
 ===========================
 
 See the individual module documentation for more information
index e70592e..f72efcb 100644 (file)
@@ -13,7 +13,7 @@ use Class::MOP::Method;
 
 use Class::MOP::Immutable;
 
-our $VERSION   = '0.38';
+our $VERSION   = '0.39';
 our $AUTHORITY = 'cpan:STEVAN';
 
 {
index b8a80b0..83b4d1d 100644 (file)
@@ -741,22 +741,23 @@ sub find_attribute_by_name {
 sub is_mutable   { 1 }
 sub is_immutable { 0 }
 
-#Why I changed this (groditi)
-# - One Metaclass may have many Classes through many Metaclass instances
-# - One Metaclass should only have one Immutable Transformer instance
-# - Each Class may have different Immutabilizing options
-# - Therefore each Metaclass instance may have different Immutabilizing options
-# - We need to store one Immutable Transformer instance per Metaclass
-# - We need to store one set of Immutable Transformer options per Class
-# - Upon make_mutable we may delete the Immutabilizing options
-# - We could clean the immutable Transformer instance when there is no more
-#     immutable Classes of that type, but we can also keep it in case
-#     another class with this same Metaclass becomes immutable. It is a case
-#     of trading of storing an instance to avoid unnecessary instantiations of
-#     Immutable Transformers. You may view this as a memory leak, however
-#     Because we have few Metaclasses, in practice it seems acceptable
-# - To allow Immutable Transformers instances to be cleaned up we could weaken
-#     the reference stored in  $IMMUTABLE_TRANSFORMERS{$class} and ||= should DWIM
+# NOTE:
+# Why I changed this (groditi)
+#  - One Metaclass may have many Classes through many Metaclass instances
+#  - One Metaclass should only have one Immutable Transformer instance
+#  - Each Class may have different Immutabilizing options
+#  - Therefore each Metaclass instance may have different Immutabilizing options
+#  - We need to store one Immutable Transformer instance per Metaclass
+#  - We need to store one set of Immutable Transformer options per Class
+#  - Upon make_mutable we may delete the Immutabilizing options
+#  - We could clean the immutable Transformer instance when there is no more
+#      immutable Classes of that type, but we can also keep it in case
+#      another class with this same Metaclass becomes immutable. It is a case
+#      of trading of storing an instance to avoid unnecessary instantiations of
+#      Immutable Transformers. You may view this as a memory leak, however
+#      Because we have few Metaclasses, in practice it seems acceptable
+#  - To allow Immutable Transformers instances to be cleaned up we could weaken
+#      the reference stored in  $IMMUTABLE_TRANSFORMERS{$class} and ||= should DWIM
 
 {
     my %IMMUTABLE_TRANSFORMERS;
@@ -1377,6 +1378,10 @@ the L<Class::MOP::Immutable> documentation.
 This method will reverse tranforamtion upon the class which
 made it immutable.
 
+=item B<create_immutable_transformer>
+
+Create a transformer suitable for making this class immutable
+
 =back
 
 =head1 AUTHORS
index e316889..3f4a4b0 100644 (file)
@@ -9,7 +9,7 @@ use Class::MOP::Method::Constructor;
 use Carp         'confess';
 use Scalar::Util 'blessed';
 
-our $VERSION   = '0.01';
+our $VERSION   = '0.02';
 our $AUTHORITY = 'cpan:STEVAN';
 
 sub new {
@@ -135,10 +135,6 @@ sub make_metaclass_immutable {
         }
     }
 
-    #I'm not sure i understand this, stevan suggested the addition i don't think its actually needed
-    #my $is_immutable = $metaclass->is_anon_class;
-    #$self->immutable_metaclass->add_method('is_anon_class' => sub { $is_immutable });
-
     $metaclass->{'___original_class'} = blessed($metaclass);
     bless $metaclass => $self->immutable_metaclass->name;
 }
@@ -166,22 +162,23 @@ sub make_metaclass_mutable {
           if $immutable->get_method('DESTROY')->blessed eq $options{destructor_class};
     }
 
-    #14:01 <@stevan> nah,. you shouldnt
-    #14:01 <@stevan> they are just inlined
-    #14:01 <@stevan> which is the default in Moose anyway
-    #14:02 <@stevan> and adding new attributes will just DWIM
-    #14:02 <@stevan> and you really cant change an attribute anyway
-    #if ($options{inline_accessors}) {
-    #    foreach my $attr_name ($immutable->get_attribute_list) {
-    #        my $attr = $immutable->get_attribute($attr_name);
-    #        $attr->remove_accessors;
-    #        $attr->install_accessors(0);
-    #    }
-    #}
-
-    #14:26 <@stevan> the only user of ::Method::Constructor is immutable
-    #14:27 <@stevan> if someone uses it outside of immutable,.. they are either: mst or groditi
-    #14:27 <@stevan> so I am not worried
+    # NOTE:
+    # 14:01 <@stevan> nah,. you shouldnt
+    # 14:01 <@stevan> they are just inlined
+    # 14:01 <@stevan> which is the default in Moose anyway
+    # 14:02 <@stevan> and adding new attributes will just DWIM
+    # 14:02 <@stevan> and you really cant change an attribute anyway
+    # if ($options{inline_accessors}) {
+    #     foreach my $attr_name ($immutable->get_attribute_list) {
+    #         my $attr = $immutable->get_attribute($attr_name);
+    #         $attr->remove_accessors;
+    #         $attr->install_accessors(0);
+    #     }
+    # }
+
+    # 14:26 <@stevan> the only user of ::Method::Constructor is immutable
+    # 14:27 <@stevan> if someone uses it outside of immutable,.. they are either: mst or groditi
+    # 14:27 <@stevan> so I am not worried
     $options{constructor_name} = 'new' unless exists $options{constructor_name};
     if ($options{inline_constructor}) {
         my $constructor_class = $options{constructor_class} || 'Class::MOP::Method::Constructor';
@@ -324,10 +321,6 @@ This will change the C<$metaclass> into the mutable version by reversing
 the immutable process. C<%options> should be the same options that were
 given to make_metaclass_immutable.
 
-=item B<create_immutable_transformer>
-
-Create a transformer suitable for making this class immutable
-
 =back
 
 =head1 AUTHORS