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