7 our $MouseVersion = $VERSION;
8 our $MooseVersion = '1.13';
10 sub MouseVersion{ $MouseVersion }
11 sub MooseVersion{ $MooseVersion }
18 Mouse::Spec - To what extent Mouse is compatible with Moose
22 This document describes Mouse version 0.86
28 printf "Mouse/%s is compatible with Moose/%s\n",
29 Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion;
33 Mouse is a subset of Moose. This document describes to what extend Mouse is
34 compatible (and incompatible) with Moose.
36 =head2 Compatibility with Moose
40 The sugary APIs are highly compatible with Moose. Methods which have the
41 same name as Moose's are expected to be compatible with Moose's.
43 =head3 Meta object protocols
45 Meta object protocols are a subset of the counterpart of Moose.
46 Their methods which have the same name as Moose's are expected to be
47 compatible with Moose's. Feel free to use these methods even if they
50 However, there are differences between Moose's MOP and Mouse's.
51 For example, meta object protocols in Mouse have no attributes by default,
52 so C<< $metaclass->meta->make_immutable() >> will not work as you expect.
53 B<Don not make metaclasses immutable>.
55 =head3 Mouse::Meta::Instance
57 Meta instance mechanism is not implemented, so you cannot change the reftype
58 of Mouse objects in the same way as Moose.
62 Role exclusion, C<exclude()>, is not implemented.
64 =head3 -metaclass in Mouse::Exporter
66 C<< use Mouse -metaclass => ... >> are not implemented.
67 Use C<< use Mouse -traits => ... >> instead.
69 =head3 Mouse::Meta::Attribute::Native
71 Native traits are not supported directly, but C<MouseX::NativeTraits> is
72 available on CPAN. Once you have installed it, you can use it as the same way
73 in Moose. That is, native traits are automatically loaded by Mouse.
75 See L<MouseX::NativeTraits> for details.
77 =head2 Notes about Moose::Cookbook
79 Many recipes in L<Moose::Cookbook> fit L<Mouse>, including:
85 L<Moose::Cookbook::Basics::Recipe1> - The (always classic) B<Point> example
89 L<Moose::Cookbook::Basics::Recipe2> - A simple B<BankAccount> example
93 L<Moose::Cookbook::Basics::Recipe3> - A lazy B<BinaryTree> example
97 L<Moose::Cookbook::Basics::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
101 L<Moose::Cookbook::Basics::Recipe5> - More subtypes, coercion in a B<Request> class
105 L<Moose::Cookbook::Basics::Recipe6> - The augment/inner example
109 L<Moose::Cookbook::Basics::Recipe7> - Making Moose fast with immutable
113 L<Moose::Cookbook::Basics::Recipe8> - Builder methods and lazy_build
117 L<Moose::Cookbook::Basics::Recipe9> - Operator overloading, subtypes, and coercion
121 L<Moose::Cookbook::Basics::Recipe10> - Using BUILDARGS and BUILD to hook into object construction
125 L<Moose::Cookbook::Roles::Recipe1> - The Moose::Role example
129 L<Moose::Cookbook::Roles::Recipe2> - Advanced Role Composition - method exclusion and aliasing
133 L<Moose::Cookbook::Roles::Recipe3> - Applying a role to an object instance
137 L<Moose::Cookbook::Meta::Recipe2> - A meta-attribute, attributes with labels
141 L<Moose::Cookbook::Meta::Recipe3> - Labels implemented via attribute traits
145 L<Moose::Cookbook::Extending::Recipe3> - Providing an alternate base object class