10 use Scalar::Util 'weaken';
12 use Class::MOP::Class;
13 use Class::MOP::Attribute;
14 use Class::MOP::Method;
16 use Class::MOP::Immutable;
19 our $VERSION = '0.56';
20 our $AUTHORITY = 'cpan:STEVAN';
23 XSLoader::load( 'Class::MOP', $VERSION );
25 *IS_RUNNING_ON_5_10 = ($] < 5.009_005)
29 # get it from MRO::Compat now ...
30 *check_package_cache_flag = \&mro::get_pkg_gen;
34 # Metaclasses are singletons, so we cache them here.
35 # there is no need to worry about destruction though
36 # because they should die only when the program dies.
37 # After all, do package definitions even get reaped?
40 # means of accessing all the metaclasses that have
41 # been initialized thus far (for mugwumps obj browser)
42 sub get_all_metaclasses { %METAS }
43 sub get_all_metaclass_instances { values %METAS }
44 sub get_all_metaclass_names { keys %METAS }
45 sub get_metaclass_by_name { $METAS{$_[0]} }
46 sub store_metaclass_by_name { $METAS{$_[0]} = $_[1] }
47 sub weaken_metaclass { weaken($METAS{$_[0]}) }
48 sub does_metaclass_exist { exists $METAS{$_[0]} && defined $METAS{$_[0]} }
49 sub remove_metaclass_by_name { $METAS{$_[0]} = undef }
52 # We only cache metaclasses, meaning instances of
53 # Class::MOP::Class. We do not cache instance of
54 # Class::MOP::Package or Class::MOP::Module. Mostly
55 # because I don't yet see a good reason to do so.
60 # see if this is already
61 # loaded in the symbol table
62 return 1 if is_class_loaded($class);
63 # otherwise require it ...
64 my $file = $class . '.pm';
66 eval { CORE::require($file) };
67 confess "Could not load class ($class) because : $@" if $@;
68 unless (does_metaclass_exist($class)) {
69 eval { Class::MOP::Class->initialize($class) };
70 confess "Could not initialize class ($class) because : $@" if $@;
72 1; # return true if it worked
78 return 1 if defined ${"${class}::VERSION"} || defined @{"${class}::ISA"};
79 foreach my $symbol (keys %{"${class}::"}) {
80 next if substr($symbol, -2, 2) eq '::';
81 return 1 if defined &{"${class}::${symbol}"};
87 ## ----------------------------------------------------------------------------
88 ## Setting up our environment ...
89 ## ----------------------------------------------------------------------------
90 ## Class::MOP needs to have a few things in the global perl environment so
91 ## that it can operate effectively. Those things are done here.
92 ## ----------------------------------------------------------------------------
94 # ... nothing yet actually ;)
96 ## ----------------------------------------------------------------------------
98 ## ----------------------------------------------------------------------------
99 ## The code below here is to bootstrap our MOP with itself. This is also
100 ## sometimes called "tying the knot". By doing this, we make it much easier
101 ## to extend the MOP through subclassing and such since now you can use the
102 ## MOP itself to extend itself.
104 ## Yes, I know, thats weird and insane, but it's a good thing, trust me :)
105 ## ----------------------------------------------------------------------------
107 # We need to add in the meta-attributes here so that
108 # any subclass of Class::MOP::* will be able to
109 # inherit them using &construct_instance
111 ## --------------------------------------------------------
112 ## Class::MOP::Package
114 Class::MOP::Package->meta->add_attribute(
115 Class::MOP::Attribute->new('$!package' => (
117 # NOTE: we need to do this in order
118 # for the instance meta-object to
119 # not fall into meta-circular death
121 # we just alias the original method
122 # rather than re-produce it here
123 'name' => \&Class::MOP::Package::name
125 init_arg => 'package',
129 Class::MOP::Package->meta->add_attribute(
130 Class::MOP::Attribute->new('%!namespace' => (
133 # we just alias the original method
134 # rather than re-produce it here
135 'namespace' => \&Class::MOP::Package::namespace
138 default => sub { \undef }
143 # use the metaclass to construct the meta-package
144 # which is a superclass of the metaclass itself :P
145 Class::MOP::Package->meta->add_method('initialize' => sub {
147 my $package_name = shift;
148 $class->meta->new_object('package' => $package_name, @_);
151 ## --------------------------------------------------------
152 ## Class::MOP::Module
155 # yeah this is kind of stretching things a bit,
156 # but truthfully the version should be an attribute
157 # of the Module, the weirdness comes from having to
158 # stick to Perl 5 convention and store it in the
159 # $VERSION package variable. Basically if you just
160 # squint at it, it will look how you want it to look.
161 # Either as a package variable, or as a attribute of
162 # the metaclass, isn't abstraction great :)
164 Class::MOP::Module->meta->add_attribute(
165 Class::MOP::Attribute->new('$!version' => (
168 # we just alias the original method
169 # rather than re-produce it here
170 'version' => \&Class::MOP::Module::version
173 default => sub { \undef }
178 # By following the same conventions as version here,
179 # we are opening up the possibility that people can
180 # use the $AUTHORITY in non-Class::MOP modules as
183 Class::MOP::Module->meta->add_attribute(
184 Class::MOP::Attribute->new('$!authority' => (
187 # we just alias the original method
188 # rather than re-produce it here
189 'authority' => \&Class::MOP::Module::authority
192 default => sub { \undef }
196 ## --------------------------------------------------------
199 Class::MOP::Class->meta->add_attribute(
200 Class::MOP::Attribute->new('%!attributes' => (
202 # NOTE: we need to do this in order
203 # for the instance meta-object to
204 # not fall into meta-circular death
206 # we just alias the original method
207 # rather than re-produce it here
208 'get_attribute_map' => \&Class::MOP::Class::get_attribute_map
210 init_arg => 'attributes',
211 default => sub { {} }
215 Class::MOP::Class->meta->add_attribute(
216 Class::MOP::Attribute->new('%!methods' => (
217 init_arg => 'methods',
220 # we just alias the original method
221 # rather than re-produce it here
222 'get_method_map' => \&Class::MOP::Class::get_method_map
224 default => sub { {} }
228 Class::MOP::Class->meta->add_attribute(
229 Class::MOP::Attribute->new('@!superclasses' => (
232 # we just alias the original method
233 # rather than re-produce it here
234 'superclasses' => \&Class::MOP::Class::superclasses
237 default => sub { \undef }
241 Class::MOP::Class->meta->add_attribute(
242 Class::MOP::Attribute->new('$!attribute_metaclass' => (
245 # we just alias the original method
246 # rather than re-produce it here
247 'attribute_metaclass' => \&Class::MOP::Class::attribute_metaclass
249 init_arg => 'attribute_metaclass',
250 default => 'Class::MOP::Attribute',
254 Class::MOP::Class->meta->add_attribute(
255 Class::MOP::Attribute->new('$!method_metaclass' => (
258 # we just alias the original method
259 # rather than re-produce it here
260 'method_metaclass' => \&Class::MOP::Class::method_metaclass
262 init_arg => 'method_metaclass',
263 default => 'Class::MOP::Method',
267 Class::MOP::Class->meta->add_attribute(
268 Class::MOP::Attribute->new('$!instance_metaclass' => (
270 # NOTE: we need to do this in order
271 # for the instance meta-object to
272 # not fall into meta-circular death
274 # we just alias the original method
275 # rather than re-produce it here
276 'instance_metaclass' => \&Class::MOP::Class::instance_metaclass
278 init_arg => 'instance_metaclass',
279 default => 'Class::MOP::Instance',
284 # we don't actually need to tie the knot with
285 # Class::MOP::Class here, it is actually handled
286 # within Class::MOP::Class itself in the
287 # construct_class_instance method.
289 ## --------------------------------------------------------
290 ## Class::MOP::Attribute
292 Class::MOP::Attribute->meta->add_attribute(
293 Class::MOP::Attribute->new('$!name' => (
296 # NOTE: we need to do this in order
297 # for the instance meta-object to
298 # not fall into meta-circular death
300 # we just alias the original method
301 # rather than re-produce it here
302 'name' => \&Class::MOP::Attribute::name
307 Class::MOP::Attribute->meta->add_attribute(
308 Class::MOP::Attribute->new('$!associated_class' => (
309 init_arg => 'associated_class',
311 # NOTE: we need to do this in order
312 # for the instance meta-object to
313 # not fall into meta-circular death
315 # we just alias the original method
316 # rather than re-produce it here
317 'associated_class' => \&Class::MOP::Attribute::associated_class
322 Class::MOP::Attribute->meta->add_attribute(
323 Class::MOP::Attribute->new('$!accessor' => (
324 init_arg => 'accessor',
325 reader => { 'accessor' => \&Class::MOP::Attribute::accessor },
326 predicate => { 'has_accessor' => \&Class::MOP::Attribute::has_accessor },
330 Class::MOP::Attribute->meta->add_attribute(
331 Class::MOP::Attribute->new('$!reader' => (
332 init_arg => 'reader',
333 reader => { 'reader' => \&Class::MOP::Attribute::reader },
334 predicate => { 'has_reader' => \&Class::MOP::Attribute::has_reader },
338 Class::MOP::Attribute->meta->add_attribute(
339 Class::MOP::Attribute->new('$!initializer' => (
340 init_arg => 'initializer',
341 reader => { 'initializer' => \&Class::MOP::Attribute::initializer },
342 predicate => { 'has_initializer' => \&Class::MOP::Attribute::has_initializer },
346 Class::MOP::Attribute->meta->add_attribute(
347 Class::MOP::Attribute->new('$!writer' => (
348 init_arg => 'writer',
349 reader => { 'writer' => \&Class::MOP::Attribute::writer },
350 predicate => { 'has_writer' => \&Class::MOP::Attribute::has_writer },
354 Class::MOP::Attribute->meta->add_attribute(
355 Class::MOP::Attribute->new('$!predicate' => (
356 init_arg => 'predicate',
357 reader => { 'predicate' => \&Class::MOP::Attribute::predicate },
358 predicate => { 'has_predicate' => \&Class::MOP::Attribute::has_predicate },
362 Class::MOP::Attribute->meta->add_attribute(
363 Class::MOP::Attribute->new('$!clearer' => (
364 init_arg => 'clearer',
365 reader => { 'clearer' => \&Class::MOP::Attribute::clearer },
366 predicate => { 'has_clearer' => \&Class::MOP::Attribute::has_clearer },
370 Class::MOP::Attribute->meta->add_attribute(
371 Class::MOP::Attribute->new('$!builder' => (
372 init_arg => 'builder',
373 reader => { 'builder' => \&Class::MOP::Attribute::builder },
374 predicate => { 'has_builder' => \&Class::MOP::Attribute::has_builder },
378 Class::MOP::Attribute->meta->add_attribute(
379 Class::MOP::Attribute->new('$!init_arg' => (
380 init_arg => 'init_arg',
381 reader => { 'init_arg' => \&Class::MOP::Attribute::init_arg },
382 predicate => { 'has_init_arg' => \&Class::MOP::Attribute::has_init_arg },
386 Class::MOP::Attribute->meta->add_attribute(
387 Class::MOP::Attribute->new('$!default' => (
388 init_arg => 'default',
389 # default has a custom 'reader' method ...
390 predicate => { 'has_default' => \&Class::MOP::Attribute::has_default },
394 Class::MOP::Attribute->meta->add_attribute(
395 Class::MOP::Attribute->new('@!associated_methods' => (
396 init_arg => 'associated_methods',
397 reader => { 'associated_methods' => \&Class::MOP::Attribute::associated_methods },
398 default => sub { [] }
402 # NOTE: (meta-circularity)
403 # This should be one of the last things done
404 # it will "tie the knot" with Class::MOP::Attribute
405 # so that it uses the attributes meta-objects
406 # to construct itself.
407 Class::MOP::Attribute->meta->add_method('new' => sub {
412 (defined $name && $name)
413 || confess "You must provide a name for the attribute";
414 $options{init_arg} = $name
415 if not exists $options{init_arg};
417 if(exists $options{builder}){
418 confess("builder must be a defined scalar value which is a method name")
419 if ref $options{builder} || !(defined $options{builder});
420 confess("Setting both default and builder is not allowed.")
421 if exists $options{default};
423 (Class::MOP::Attribute::is_default_a_coderef(\%options))
424 || confess("References are not allowed as default values, you must ".
425 "wrap then in a CODE reference (ex: sub { [] } and not [])")
426 if exists $options{default} && ref $options{default};
428 # return the new object
429 $class->meta->new_object(name => $name, %options);
432 Class::MOP::Attribute->meta->add_method('clone' => sub {
434 $self->meta->clone_object($self, @_);
437 ## --------------------------------------------------------
438 ## Class::MOP::Method
440 Class::MOP::Method->meta->add_attribute(
441 Class::MOP::Attribute->new('&!body' => (
443 reader => { 'body' => \&Class::MOP::Method::body },
447 ## --------------------------------------------------------
448 ## Class::MOP::Method::Wrapped
451 # the way this item is initialized, this
452 # really does not follow the standard
453 # practices of attributes, but we put
454 # it here for completeness
455 Class::MOP::Method::Wrapped->meta->add_attribute(
456 Class::MOP::Attribute->new('%!modifier_table')
459 ## --------------------------------------------------------
460 ## Class::MOP::Method::Generated
462 Class::MOP::Method::Generated->meta->add_attribute(
463 Class::MOP::Attribute->new('$!is_inline' => (
464 init_arg => 'is_inline',
465 reader => { 'is_inline' => \&Class::MOP::Method::Generated::is_inline },
469 ## --------------------------------------------------------
470 ## Class::MOP::Method::Accessor
472 Class::MOP::Method::Accessor->meta->add_attribute(
473 Class::MOP::Attribute->new('$!attribute' => (
474 init_arg => 'attribute',
476 'associated_attribute' => \&Class::MOP::Method::Accessor::associated_attribute
481 Class::MOP::Method::Accessor->meta->add_attribute(
482 Class::MOP::Attribute->new('$!accessor_type' => (
483 init_arg => 'accessor_type',
484 reader => { 'accessor_type' => \&Class::MOP::Method::Accessor::accessor_type },
489 ## --------------------------------------------------------
490 ## Class::MOP::Method::Constructor
492 Class::MOP::Method::Constructor->meta->add_attribute(
493 Class::MOP::Attribute->new('%!options' => (
494 init_arg => 'options',
496 'options' => \&Class::MOP::Method::Constructor::options
501 Class::MOP::Method::Constructor->meta->add_attribute(
502 Class::MOP::Attribute->new('$!associated_metaclass' => (
503 init_arg => 'metaclass',
505 'associated_metaclass' => \&Class::MOP::Method::Constructor::associated_metaclass
510 ## --------------------------------------------------------
511 ## Class::MOP::Instance
514 # these don't yet do much of anything, but are just
515 # included for completeness
517 Class::MOP::Instance->meta->add_attribute(
518 Class::MOP::Attribute->new('$!meta')
521 Class::MOP::Instance->meta->add_attribute(
522 Class::MOP::Attribute->new('@!slots')
525 ## --------------------------------------------------------
526 ## Now close all the Class::MOP::* classes
529 # we don't need to inline the
530 # constructors or the accessors
531 # this only lengthens the compile
532 # time of the MOP, and gives us
533 # no actual benefits.
535 $_->meta->make_immutable(
536 inline_constructor => 0,
537 inline_accessors => 0,
543 Class::MOP::Attribute
549 Class::MOP::Method::Generated
551 Class::MOP::Method::Accessor
552 Class::MOP::Method::Constructor
553 Class::MOP::Method::Wrapped
564 Class::MOP - A Meta Object Protocol for Perl 5
568 This module is a fully functioning meta object protocol for the
569 Perl 5 object system. It makes no attempt to change the behavior or
570 characteristics of the Perl 5 object system, only to create a
571 protocol for its manipulation and introspection.
573 That said, it does attempt to create the tools for building a rich
574 set of extensions to the Perl 5 object system. Every attempt has been
575 made for these tools to keep to the spirit of the Perl 5 object
576 system that we all know and love.
578 This documentation is admittedly sparse on details, as time permits
579 I will try to improve them. For now, I suggest looking at the items
580 listed in the L<SEE ALSO> section for more information. In particular
581 the book "The Art of the Meta Object Protocol" was very influential
582 in the development of this system.
584 =head2 What is a Meta Object Protocol?
586 A meta object protocol is an API to an object system.
588 To be more specific, it is a set of abstractions of the components of
589 an object system (typically things like; classes, object, methods,
590 object attributes, etc.). These abstractions can then be used to both
591 inspect and manipulate the object system which they describe.
593 It can be said that there are two MOPs for any object system; the
594 implicit MOP, and the explicit MOP. The implicit MOP handles things
595 like method dispatch or inheritance, which happen automatically as
596 part of how the object system works. The explicit MOP typically
597 handles the introspection/reflection features of the object system.
598 All object systems have implicit MOPs, without one, they would not
599 work. Explict MOPs however as less common, and depending on the
600 language can vary from restrictive (Reflection in Java or C#) to
601 wide open (CLOS is a perfect example).
603 =head2 Yet Another Class Builder!! Why?
605 This is B<not> a class builder so much as it is a I<class builder
606 B<builder>>. My intent is that an end user does not use this module
607 directly, but instead this module is used by module authors to
608 build extensions and features onto the Perl 5 object system.
610 =head2 Who is this module for?
612 This module is specifically for anyone who has ever created or
613 wanted to create a module for the Class:: namespace. The tools which
614 this module will provide will hopefully make it easier to do more
615 complex things with Perl 5 classes by removing such barriers as
616 the need to hack the symbol tables, or understand the fine details
619 =head2 What changes do I have to make to use this module?
621 This module was designed to be as unintrusive as possible. Many of
622 its features are accessible without B<any> change to your existsing
623 code at all. It is meant to be a compliment to your existing code and
624 not an intrusion on your code base. Unlike many other B<Class::>
625 modules, this module B<does not> require you subclass it, or even that
626 you C<use> it in within your module's package.
628 The only features which requires additions to your code are the
629 attribute handling and instance construction features, and these are
630 both completely optional features. The only reason for this is because
631 Perl 5's object system does not actually have these features built
632 in. More information about this feature can be found below.
634 =head2 A Note about Performance?
636 It is a common misconception that explict MOPs are performance drains.
637 But this is not a universal truth at all, it is an side-effect of
638 specific implementations. For instance, using Java reflection is much
639 slower because the JVM cannot take advantage of any compiler
640 optimizations, and the JVM has to deal with much more runtime type
641 information as well. Reflection in C# is marginally better as it was
642 designed into the language and runtime (the CLR). In contrast, CLOS
643 (the Common Lisp Object System) was built to support an explicit MOP,
644 and so performance is tuned for it.
646 This library in particular does it's absolute best to avoid putting
647 B<any> drain at all upon your code's performance. In fact, by itself
648 it does nothing to affect your existing code. So you only pay for
649 what you actually use.
651 =head2 About Metaclass compatibility
653 This module makes sure that all metaclasses created are both upwards
654 and downwards compatible. The topic of metaclass compatibility is
655 highly esoteric and is something only encountered when doing deep and
656 involved metaclass hacking. There are two basic kinds of metaclass
657 incompatibility; upwards and downwards.
659 Upwards metaclass compatibility means that the metaclass of a
660 given class is either the same as (or a subclass of) all of the
663 Downward metaclass compatibility means that the metaclasses of a
664 given class's anscestors are all either the same as (or a subclass
667 Here is a diagram showing a set of two classes (C<A> and C<B>) and
668 two metaclasses (C<Meta::A> and C<Meta::B>) which have correct
669 metaclass compatibility both upwards and downwards.
671 +---------+ +---------+
672 | Meta::A |<----| Meta::B | <....... (instance of )
673 +---------+ +---------+ <------- (inherits from)
676 +---------+ +---------+
678 +---------+ +---------+
680 As I said this is a highly esoteric topic and one you will only run
681 into if you do a lot of subclassing of B<Class::MOP::Class>. If you
682 are interested in why this is an issue see the paper
683 I<Uniform and safe metaclass composition> linked to in the
684 L<SEE ALSO> section of this document.
686 =head2 Using custom metaclasses
688 Always use the metaclass pragma when using a custom metaclass, this
689 will ensure the proper initialization order and not accidentely
690 create an incorrect type of metaclass for you. This is a very rare
691 problem, and one which can only occur if you are doing deep metaclass
692 programming. So in other words, don't worry about it.
696 The protocol is divided into 4 main sub-protocols:
700 =item The Class protocol
702 This provides a means of manipulating and introspecting a Perl 5
703 class. It handles all of symbol table hacking for you, and provides
704 a rich set of methods that go beyond simple package introspection.
706 See L<Class::MOP::Class> for more details.
708 =item The Attribute protocol
710 This provides a consistent represenation for an attribute of a
711 Perl 5 class. Since there are so many ways to create and handle
712 attributes in Perl 5 OO, this attempts to provide as much of a
713 unified approach as possible, while giving the freedom and
714 flexibility to subclass for specialization.
716 See L<Class::MOP::Attribute> for more details.
718 =item The Method protocol
720 This provides a means of manipulating and introspecting methods in
721 the Perl 5 object system. As with attributes, there are many ways to
722 approach this topic, so we try to keep it pretty basic, while still
723 making it possible to extend the system in many ways.
725 See L<Class::MOP::Method> for more details.
727 =item The Instance protocol
729 This provides a layer of abstraction for creating object instances.
730 Since the other layers use this protocol, it is relatively easy to
731 change the type of your instances from the default HASH ref to other
732 types of references. Several examples are provided in the F<examples/>
733 directory included in this distribution.
735 See L<Class::MOP::Instance> for more details.
745 =item I<IS_RUNNING_ON_5_10>
747 We set this constant depending on what version perl we are on, this
748 allows us to take advantage of new 5.10 features and stay backwards
753 =head2 Utility functions
757 =item B<load_class ($class_name)>
759 This will load a given C<$class_name> and if it does not have an
760 already initialized metaclass, then it will intialize one for it.
761 This function can be used in place of tricks like
762 C<eval "use $module"> or using C<require>.
764 =item B<is_class_loaded ($class_name)>
766 This will return a boolean depending on if the C<$class_name> has
769 NOTE: This does a basic check of the symbol table to try and
770 determine as best it can if the C<$class_name> is loaded, it
771 is probably correct about 99% of the time.
773 =item B<check_package_cache_flag ($pkg)>
775 This will return an integer that is managed by C<Class::MOP::Class>
776 to determine if a module's symbol table has been altered.
778 In Perl 5.10 or greater, this flag is package specific. However in
779 versions prior to 5.10, this will use the C<PL_sub_generation> variable
780 which is not package specific.
782 =item B<get_code_info ($code)>
784 This function returns two values, the name of the package the C<$code>
785 is from and the name of the C<$code> itself. This is used by several
786 elements of the MOP to detemine where a given C<$code> reference is from.
790 =head2 Metaclass cache functions
792 Class::MOP holds a cache of metaclasses, the following are functions
793 (B<not methods>) which can be used to access that cache. It is not
794 recommended that you mess with this, bad things could happen. But if
795 you are brave and willing to risk it, go for it.
799 =item B<get_all_metaclasses>
801 This will return an hash of all the metaclass instances that have
802 been cached by B<Class::MOP::Class> keyed by the package name.
804 =item B<get_all_metaclass_instances>
806 This will return an array of all the metaclass instances that have
807 been cached by B<Class::MOP::Class>.
809 =item B<get_all_metaclass_names>
811 This will return an array of all the metaclass names that have
812 been cached by B<Class::MOP::Class>.
814 =item B<get_metaclass_by_name ($name)>
816 This will return a cached B<Class::MOP::Class> instance of nothing
817 if no metaclass exist by that C<$name>.
819 =item B<store_metaclass_by_name ($name, $meta)>
821 This will store a metaclass in the cache at the supplied C<$key>.
823 =item B<weaken_metaclass ($name)>
825 In rare cases it is desireable to store a weakened reference in
826 the metaclass cache. This function will weaken the reference to
827 the metaclass stored in C<$name>.
829 =item B<does_metaclass_exist ($name)>
831 This will return true of there exists a metaclass stored in the
832 C<$name> key and return false otherwise.
834 =item B<remove_metaclass_by_name ($name)>
836 This will remove a the metaclass stored in the C<$name> key.
844 There are very few books out on Meta Object Protocols and Metaclasses
845 because it is such an esoteric topic. The following books are really
846 the only ones I have found. If you know of any more, B<I<please>>
847 email me and let me know, I would love to hear about them.
851 =item "The Art of the Meta Object Protocol"
853 =item "Advances in Object-Oriented Metalevel Architecture and Reflection"
855 =item "Putting MetaClasses to Work"
857 =item "Smalltalk: The Language"
865 =item Uniform and safe metaclass composition
867 An excellent paper by the people who brought us the original Traits paper.
868 This paper is on how Traits can be used to do safe metaclass composition,
869 and offers an excellent introduction section which delves into the topic of
870 metaclass compatibility.
872 L<http://www.iam.unibe.ch/~scg/Archive/Papers/Duca05ySafeMetaclassTrait.pdf>
874 =item Safe Metaclass Programming
876 This paper seems to precede the above paper, and propose a mix-in based
877 approach as opposed to the Traits based approach. Both papers have similar
878 information on the metaclass compatibility problem space.
880 L<http://citeseer.ist.psu.edu/37617.html>
888 =item The Perl 6 MetaModel work in the Pugs project
892 =item L<http://svn.openfoundry.org/pugs/perl5/Perl6-MetaModel>
894 =item L<http://svn.openfoundry.org/pugs/perl5/Perl6-ObjectSpace>
904 =item CPAN Module Review of Class::MOP
906 L<http://www.oreillynet.com/onlamp/blog/2006/06/cpan_module_review_classmop.html>
910 =head1 SIMILAR MODULES
912 As I have said above, this module is a class-builder-builder, so it is
913 not the same thing as modules like L<Class::Accessor> and
914 L<Class::MethodMaker>. That being said there are very few modules on CPAN
915 with similar goals to this module. The one I have found which is most
916 like this module is L<Class::Meta>, although it's philosophy and the MOP it
917 creates are very different from this modules.
921 All complex software has bugs lurking in it, and this module is no
922 exception. If you find a bug please either email me, or add the bug
925 =head1 ACKNOWLEDGEMENTS
931 Thanks to Rob for actually getting the development of this module kick-started.
937 Stevan Little E<lt>stevan@iinteractive.comE<gt>
939 B<with contributions from:>
941 Brandon (blblack) Black
943 Guillermo (groditi) Roditi
947 Rob (robkinyon) Kinyon
949 Yuval (nothingmuch) Kogman
951 Scott (konobi) McWhirter
953 =head1 COPYRIGHT AND LICENSE
955 Copyright 2006-2008 by Infinity Interactive, Inc.
957 L<http://www.iinteractive.com>
959 This library is free software; you can redistribute it and/or modify
960 it under the same terms as Perl itself.