* Class::MOP::Class
- make_{immutable,mutable} now return 1
(cause Sartak asked)
+ - improved error handling in ->create method
* Class::MOP::Object
- localizing the Data::Dumper configurations so
that it does not pollute others (RT #33509)
+ * Class::MOP::Class
+ Class::MOP::Package
+ Class::MOP::Module
+ Class::MOP::Method
+ Class::MOP::Attribute
+ - these classes no longer define their own ->meta,
+ but instead just inherit from Class::MOP::Object
+
+ * Class::MOP::Instance
+ Class::MOP::Immutable
+ - these classes now inherit from Class::MOP::Object
+
* t/
- fixed the filename length on several
test files so we install on VMS better
use Carp 'confess';
use Scalar::Util 'blessed', 'reftype', 'weaken';
-our $VERSION = '0.23';
+our $VERSION = '0.24';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Object';
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
-
# NOTE: (meta-circularity)
# This method will be replaced in the
# boostrap section of Class::MOP, by
use base 'Class::MOP::Module';
-# Self-introspection
-
-sub meta { Class::MOP::Class->initialize(blessed($_[0]) || $_[0]) }
-
# Creation
sub initialize {
"(I found an uneven number of params in \@_)";
my (%options) = @_;
+
+ (ref $options{superclasses} eq 'ARRAY')
+ || confess "You must pass an ARRAY ref of superclasses"
+ if exists $options{superclasses};
+
+ (ref $options{attributes} eq 'ARRAY')
+ || confess "You must pass an ARRAY ref of attributes"
+ if exists $options{attributes};
+
+ (ref $options{methods} eq 'HASH')
+ || confess "You must pass an HASH ref of methods"
+ if exists $options{methods};
my $code = "package $package_name;";
$code .= "\$$package_name\:\:VERSION = '" . $options{version} . "';"
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.04';
+our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
+use base 'Class::MOP::Object';
+
sub new {
my ($class, $metaclass, $options) = @_;
use Scalar::Util 'weaken', 'blessed';
-our $VERSION = '0.04';
+our $VERSION = '0.05';
our $AUTHORITY = 'cpan:STEVAN';
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
+use base 'Class::MOP::Object';
sub new {
my ($class, $meta, @attrs) = @_;
use Carp 'confess';
use Scalar::Util 'reftype', 'blessed';
-#use B 'svref_2object';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Object';
# they should act like CODE refs.
use overload '&{}' => sub { $_[0]->body }, fallback => 1;
-# introspection
-
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
-
# construction
sub wrap {
use Scalar::Util 'blessed';
-our $VERSION = '0.02';
+our $VERSION = '0.03';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Package';
-# introspection
-
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
-
sub version {
my $self = shift;
${$self->get_package_symbol('$VERSION')};
use Scalar::Util 'blessed';
use Carp 'confess';
-our $VERSION = '0.07';
+our $VERSION = '0.08';
our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Object';
-# introspection
-
-sub meta {
- require Class::MOP::Class;
- Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
-}
-
# creation ...
sub initialize {
use strict;
use warnings;
-use Test::More tests => 205;
+use Test::More tests => 199;
use Test::Exception;
BEGIN {
isa_ok($class_mop_module_meta, 'Class::MOP::Module');
my @class_mop_package_methods = qw(
- meta
initialize
);
my @class_mop_module_methods = qw(
- meta
version authority identifier
);
my @class_mop_class_methods = qw(
- meta
initialize reinitialize create
use strict;
use warnings;
-use Test::More tests => 61;
+use Test::More tests => 60;
use Test::Exception;
BEGIN {
isa_ok($meta, 'Class::MOP::Class');
my @methods = qw(
- meta
new clone
initialize_instance_slot