Revision history for Perl extension Class-MOP.
0.32
+ + added Class::MOP::Object so that the
+ metamodel is more complete (and closer
+ to what Perl 6 will probably be).
+
* Class::MOP::Package
- refactored entire class, this is now
the primary gateway between the metaclass
and the Perl 5 symbol table
- added many tests for this
+ - this class is now a subclass of
+ Class::MOP::Object
* Class::MOP::Class
- refactored all symbol table access to
Class::MOP::Attribute->meta->make_immutable(inline_constructor => 0);
Class::MOP::Method ->meta->make_immutable(inline_constructor => 0);
Class::MOP::Instance ->meta->make_immutable(inline_constructor => 0);
+Class::MOP::Object ->meta->make_immutable(inline_constructor => 0);
1;
--- /dev/null
+
+package Class::MOP::Object;
+
+use strict;
+use warnings;
+
+use Scalar::Util 'blessed';
+
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
+
+# introspection
+
+sub meta {
+ require Class::MOP::Class;
+ Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Class::MOP::Object - Object Meta Object
+
+=head1 DESCRIPTION
+
+This class is basically a stub, it provides no functionality at all,
+and really just exists to make the Class::MOP metamodel complete.
+
+ ......
+ : :
+ : v
+ +-------------------+
+ +-----| Class::MOP::Class |
+ | +-------------------+
+ | ^ ^ ^
+ v : : :
+ +--------------------+ : +--------------------+
+ | Class::MOP::Module | : | Class::MOP::Object |
+ +--------------------+ : +--------------------+
+ | : ^
+ | : |
+ | +---------------------+ |
+ +--->| Class::MOP::Package |-----+
+ +---------------------+
+
+ legend:
+ ..(is an instance of)..>
+ --(is a subclass of)-->
+
+A deeper discussion of this model is currently beyond the scope of
+this documenation.
+
+=head1 METHODS
+
+=over 4
+
+=item B<meta>
+
+=back
+
+=head1 AUTHORS
+
+Stevan Little E<lt>stevan@iinteractive.comE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright 2006 by Infinity Interactive, Inc.
+
+L<http://www.iinteractive.com>
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
\ No newline at end of file
our $VERSION = '0.02';
our $AUTHORITY = 'cpan:STEVAN';
+use base 'Class::MOP::Object';
+
# introspection
sub meta {
use strict;
use warnings;
-use Test::More tests => 14;
+use Test::More tests => 16;
BEGIN {
use_ok('Class::MOP');
use_ok('Class::MOP::Attribute');
use_ok('Class::MOP::Method');
use_ok('Class::MOP::Instance');
+ use_ok('Class::MOP::Object');
}
# make sure we are tracking metaclasses correctly
'Class::MOP::Module' => Class::MOP::Module->meta,
'Class::MOP::Class' => Class::MOP::Class->meta,
'Class::MOP::Method' => Class::MOP::Method->meta,
- 'Class::MOP::Instance' => Class::MOP::Instance->meta,
+ 'Class::MOP::Instance' => Class::MOP::Instance->meta,
+ 'Class::MOP::Object' => Class::MOP::Object->meta,
);
ok($_->is_immutable(), '... ' . $_->name . ' is immutable') for values %METAS;
Class::MOP::Class->meta,
Class::MOP::Instance->meta,
Class::MOP::Method->meta,
- Class::MOP::Module->meta,
+ Class::MOP::Module->meta,
+ Class::MOP::Object->meta,
Class::MOP::Package->meta,
],
'... got all the metaclass instances');
Class::MOP::Instance
Class::MOP::Method
Class::MOP::Module
+ Class::MOP::Object
Class::MOP::Package
/ ],
'... got all the metaclass names');
\ No newline at end of file
[ qw/
Class::MOP::Class
Class::MOP::Module
- Class::MOP::Package
+ Class::MOP::Package
+ Class::MOP::Object
/ ],
'... Class::MOP::Class->class_precedence_list == [ Class::MOP::Class Class::MOP::Module Class::MOP::Package ]');