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