Comment
[gitmo/Mouse.git] / lib / Mouse / Spec.pm
CommitLineData
d3f79b34 1package Mouse::Spec;
d3f79b34 2use strict;
43e6a50b 3use warnings;
d3f79b34 4
a7e3b78e 5our $VERSION = '0.76';
d3f79b34 6
7our $MouseVersion = $VERSION;
29012b56 8our $MooseVersion = '1.10';
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
a7e3b78e 22This document describes Mouse version 0.76
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
a35fd8bb 50However, there are differences between Moose's MOP and Mouse's,
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
4f74e488 57Meta instance mechanism is not implemented.
58
59=head3 Role exclusion
60
61Role exclusion, C<exclude()>, is not implemented.
62
dad32ff2 63=head3 -metaclass in Mouse::Exporter
4f74e488 64
dad32ff2 65C<< use Mouse -metaclass => ... >> are not implemented.
66Use C<< use Mouse -traits => ... >> instead.
a25ca8d6 67
4fbbc656 68=head3 Mouse::Meta::Attribute::Native
69
70Native traits are not supported directly, but C<MouseX::NativeTraits> is
71available on CPAN. Once you have installed it, you can use it as the same way
72in Moose. That is, native traits are automatically loaded by Mouse.
73
74See L<MouseX::NativeTraits> for details.
75
7fc043cc 76=head2 Notes about Moose::Cookbook
77
78Many recipes in L<Moose::Cookbook> fit L<Mouse>, including:
79
80=over 4
81
82=item *
83
84L<Moose::Cookbook::Basics::Recipe1> - The (always classic) B<Point> example
85
86=item *
87
278448b8 88L<Moose::Cookbook::Basics::Recipe2> - A simple B<BankAccount> example
7fc043cc 89
90=item *
91
92L<Moose::Cookbook::Basics::Recipe3> - A lazy B<BinaryTree> example
93
94=item *
95
96L<Moose::Cookbook::Basics::Recipe4> - Subtypes, and modeling a simple B<Company> class hierarchy
97
98=item *
99
278448b8 100L<Moose::Cookbook::Basics::Recipe5> - More subtypes, coercion in a B<Request> class
7fc043cc 101
102=item *
103
278448b8 104L<Moose::Cookbook::Basics::Recipe6> - The augment/inner example
7fc043cc 105
106=item *
107
278448b8 108L<Moose::Cookbook::Basics::Recipe7> - Making Moose fast with immutable
7fc043cc 109
110=item *
111
278448b8 112L<Moose::Cookbook::Basics::Recipe8> - Builder methods and lazy_build
7fc043cc 113
114=item *
115
278448b8 116L<Moose::Cookbook::Basics::Recipe9> - Operator overloading, subtypes, and coercion
7fc043cc 117
118=item *
119
278448b8 120L<Moose::Cookbook::Basics::Recipe10> - Using BUILDARGS and BUILD to hook into object construction
7fc043cc 121
122=item *
123
278448b8 124L<Moose::Cookbook::Roles::Recipe1> - The Moose::Role example
7fc043cc 125
126=item *
127
8006ea01 128L<Moose::Cookbook::Roles::Recipe2> - Advanced Role Composition - method exclusion and aliasing
7fc043cc 129
130=item *
131
278448b8 132L<Moose::Cookbook::Roles::Recipe3> - Applying a role to an object instance
7fc043cc 133
134=item *
135
278448b8 136L<Moose::Cookbook::Meta::Recipe2> - A meta-attribute, attributes with labels
7fc043cc 137
138=item *
139
278448b8 140L<Moose::Cookbook::Meta::Recipe3> - Labels implemented via attribute traits
7fc043cc 141
142=item *
143
278448b8 144L<Moose::Cookbook::Extending::Recipe3> - Providing an alternate base object class
7fc043cc 145
146=back
147
148=head1 SEE ALSO
149
150L<Mouse>
151
de236787 152L<Moose>
153
154L<Moose::Manual>
155
156L<Moose::Cookbook>
157
7fc043cc 158=cut
159