Checking in changes prior to tagging of version 0.95.
[gitmo/Mouse.git] / lib / Mouse / Spec.pm
CommitLineData
d3f79b34 1package Mouse::Spec;
d3f79b34 2use strict;
43e6a50b 3use warnings;
d3f79b34 4
14cf9b5a 5our $VERSION = '0.95';
d3f79b34 6
7our $MouseVersion = $VERSION;
c2a2fa52 8our $MooseVersion = '1.13';
d3f79b34 9
1b9e472d 10sub MouseVersion{ $MouseVersion }
11sub MooseVersion{ $MooseVersion }
12
d3f79b34 131;
14__END__
7fc043cc 15
16=head1 NAME
17
18Mouse::Spec - To what extent Mouse is compatible with Moose
19
a25ca8d6 20=head1 VERSION
21
14cf9b5a 22This document describes Mouse version 0.95
a25ca8d6 23
976891fa 24=head1 SYNOPSIS
25
26 use Mouse::Spec;
27
28 printf "Mouse/%s is compatible with Moose/%s\n",
29 Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion;
30
7fc043cc 31=head1 DESCRIPTION
32
dad32ff2 33Mouse is a subset of Moose. This document describes to what extend Mouse is
503ed648 34compatible (and incompatible) with Moose.
ff012e5d 35
36=head2 Compatibility with Moose
37
a35fd8bb 38=head3 Sugary APIs
dad32ff2 39
a35fd8bb 40The sugary APIs are highly compatible with Moose. Methods which have the
41same name as Moose's are expected to be compatible with Moose's.
ff012e5d 42
43=head3 Meta object protocols
44
503ed648 45Meta object protocols are a subset of the counterpart of Moose.
46Their methods which have the same name as Moose's are expected to be
47compatible with Moose's. Feel free to use these methods even if they
48are not documented.
dad32ff2 49
c2a2fa52 50However, there are differences between Moose's MOP and Mouse's.
a35fd8bb 51For example, meta object protocols in Mouse have no attributes by default,
503ed648 52so C<< $metaclass->meta->make_immutable() >> will not work as you expect.
f6387355 53B<Don not make metaclasses immutable>.
ff012e5d 54
de236787 55=head3 Mouse::Meta::Instance
ff012e5d 56
c2a2fa52 57Meta instance mechanism is not implemented, so you cannot change the reftype
58of Mouse objects in the same way as Moose.
4f74e488 59
60=head3 Role exclusion
61
62Role exclusion, C<exclude()>, is not implemented.
63
dad32ff2 64=head3 -metaclass in Mouse::Exporter
4f74e488 65
dad32ff2 66C<< use Mouse -metaclass => ... >> are not implemented.
67Use C<< use Mouse -traits => ... >> instead.
a25ca8d6 68
4fbbc656 69=head3 Mouse::Meta::Attribute::Native
70
71Native traits are not supported directly, but C<MouseX::NativeTraits> is
72available on CPAN. Once you have installed it, you can use it as the same way
73in Moose. That is, native traits are automatically loaded by Mouse.
74
75See L<MouseX::NativeTraits> for details.
76
7fc043cc 77=head2 Notes about Moose::Cookbook
78
79Many recipes in L<Moose::Cookbook> fit L<Mouse>, including:
80
81=over 4
82
83=item *
84
85L<Moose::Cookbook::Basics::Recipe1> - The (always classic) B<Point> example
86
87=item *
88
278448b8 89L<Moose::Cookbook::Basics::Recipe2> - A simple B<BankAccount> example
7fc043cc 90
91=item *
92
93L<Moose::Cookbook::Basics::Recipe3> - A lazy B<BinaryTree> example
94
95=item *
96
97L<Moose::Cookbook::Basics::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
98
99=item *
100
278448b8 101L<Moose::Cookbook::Basics::Recipe5> - More subtypes, coercion in a B<Request> class
7fc043cc 102
103=item *
104
278448b8 105L<Moose::Cookbook::Basics::Recipe6> - The augment/inner example
7fc043cc 106
107=item *
108
278448b8 109L<Moose::Cookbook::Basics::Recipe7> - Making Moose fast with immutable
7fc043cc 110
111=item *
112
278448b8 113L<Moose::Cookbook::Basics::Recipe8> - Builder methods and lazy_build
7fc043cc 114
115=item *
116
278448b8 117L<Moose::Cookbook::Basics::Recipe9> - Operator overloading, subtypes, and coercion
7fc043cc 118
119=item *
120
278448b8 121L<Moose::Cookbook::Basics::Recipe10> - Using BUILDARGS and BUILD to hook into object construction
7fc043cc 122
123=item *
124
278448b8 125L<Moose::Cookbook::Roles::Recipe1> - The Moose::Role example
7fc043cc 126
127=item *
128
8006ea01 129L<Moose::Cookbook::Roles::Recipe2> - Advanced Role Composition - method exclusion and aliasing
7fc043cc 130
131=item *
132
278448b8 133L<Moose::Cookbook::Roles::Recipe3> - Applying a role to an object instance
7fc043cc 134
135=item *
136
278448b8 137L<Moose::Cookbook::Meta::Recipe2> - A meta-attribute, attributes with labels
7fc043cc 138
139=item *
140
278448b8 141L<Moose::Cookbook::Meta::Recipe3> - Labels implemented via attribute traits
7fc043cc 142
143=item *
144
278448b8 145L<Moose::Cookbook::Extending::Recipe3> - Providing an alternate base object class
7fc043cc 146
147=back
148
149=head1 SEE ALSO
150
151L<Mouse>
152
de236787 153L<Moose>
154
155L<Moose::Manual>
156
157L<Moose::Cookbook>
158
7fc043cc 159=cut
160