Mouse::Spec - To what extent Mouse is compatible with Moose
This document describes Mouse version 1.09
use Mouse::Spec; printf "Mouse/%s is compatible with Moose/%s\n", Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion;
Mouse is a subset of Moose. This document describes to what extend Mouse is compatible (and incompatible) with Moose.
The sugary APIs are highly compatible with Moose. Methods which have the same name as Moose's are expected to be compatible with Moose's.
Meta object protocols are a subset of the counterpart of Moose. Their methods which have the same name as Moose's are expected to be compatible with Moose's. Feel free to use these methods even if they are not documented.
However, there are differences between Moose's MOP and Mouse's. For example, meta object protocols in Mouse have no attributes by default, so
$metaclass->meta->make_immutable() will not work as you expect. Don not make metaclasses immutable.
Meta instance mechanism is not implemented, so you cannot change the reftype of Mouse objects in the same way as Moose.
exclude(), is not implemented.
use Mouse -metaclass => ... are not implemented. Use
use Mouse -traits => ... instead.
Native traits are not supported directly, but
MouseX::NativeTraits is available on CPAN. Once you have installed it, you can use it as the same way in Moose. That is, native traits are automatically loaded by Mouse.
See MouseX::NativeTraits for details.