bump version to 1.10 so we can dep on it in Moose
[gitmo/Class-MOP.git] / lib / Class / MOP.pm
index fbadae1..a1c86dc 100644 (file)
@@ -9,7 +9,7 @@ use 5.008;
 use MRO::Compat;
 
 use Carp          'confess';
-use Scalar::Util  'weaken', 'reftype', 'blessed';
+use Scalar::Util  'weaken', 'isweak', 'reftype', 'blessed';
 use Data::OptList;
 use Try::Tiny;
 
@@ -29,7 +29,7 @@ BEGIN {
     *check_package_cache_flag = \&mro::get_pkg_gen;
 }
 
-our $VERSION   = '1.01';
+our $VERSION   = '1.10';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
@@ -37,7 +37,6 @@ our $AUTHORITY = 'cpan:STEVAN';
 require XSLoader;
 XSLoader::load( __PACKAGE__, $XS_VERSION );
 
-
 {
     # Metaclasses are singletons, so we cache them here.
     # there is no need to worry about destruction though
@@ -52,6 +51,7 @@ XSLoader::load( __PACKAGE__, $XS_VERSION );
     sub get_metaclass_by_name       { $METAS{$_[0]}         }
     sub store_metaclass_by_name     { $METAS{$_[0]} = $_[1] }
     sub weaken_metaclass            { weaken($METAS{$_[0]}) }
+    sub metaclass_is_weak           { isweak($METAS{$_[0]}) }
     sub does_metaclass_exist        { exists $METAS{$_[0]} && defined $METAS{$_[0]} }
     sub remove_metaclass_by_name    { delete $METAS{$_[0]}; return }
 
@@ -549,13 +549,6 @@ Class::MOP::Method->meta->add_attribute(
     ))
 );
 
-Class::MOP::Method->meta->add_method('clone' => sub {
-    my $self  = shift;
-    my $clone = $self->meta->clone_object($self, @_);
-    $clone->_set_original_method($self);
-    return $clone;
-});
-
 ## --------------------------------------------------------
 ## Class::MOP::Method::Wrapped
 
@@ -672,6 +665,18 @@ Class::MOP::Instance->meta->add_attribute(
     ),
 );
 
+## --------------------------------------------------------
+## Class::MOP::Object
+
+# need to replace the meta method there with a real meta method object
+Class::MOP::Object->meta->_add_meta_method('meta');
+
+## --------------------------------------------------------
+## Class::MOP::Mixin
+
+# need to replace the meta method there with a real meta method object
+Class::MOP::Mixin->meta->_add_meta_method('meta');
+
 require Class::MOP::Deprecated unless our $no_deprecated;
 
 # we need the meta instance of the meta instance to be created now, in order
@@ -708,6 +713,8 @@ $_->meta->make_immutable(
     Class::MOP::Method::Accessor
     Class::MOP::Method::Constructor
     Class::MOP::Method::Wrapped
+
+    Class::MOP::Method::Meta
 /;
 
 $_->meta->make_immutable(
@@ -1062,6 +1069,11 @@ store a weakened reference in the metaclass cache. This
 function will weaken the reference to the metaclass stored
 in C<$name>.
 
+=item B<Class::MOP::metaclass_is_weak($name)>
+
+Returns true if the metaclass for C<$name> has been weakened
+(via C<weaken_metaclass>).
+
 =item B<Class::MOP::does_metaclass_exist($name)>
 
 This will return true of there exists a metaclass stored in the
@@ -1138,7 +1150,7 @@ L<http://citeseer.ist.psu.edu/37617.html>
 
 =item L<http://svn.openfoundry.org/pugs/misc/Perl-MetaModel/>
 
-=item L<http://svn.openfoundry.org/pugs/perl5/Perl6-ObjectSpace>
+=item L<http://github.com/perl6/p5-modules/tree/master/Perl6-ObjectSpace/>
 
 =back