use strict;
use warnings;
-our $VERSION = '0.18';
+our $VERSION = '0.18';
+our $AUTHORITY = 'cpan:STEVAN';
use Scalar::Util 'blessed', 'reftype';
use Carp 'confess';
meta-model; however Moose is B<NOT> an experiment/prototype, it is
for B<real>.
-=head2 Can I, should I use this in production?
+=head2 Is this ready for use in production?
+
+Yes, I believe that it is.
I have two medium-to-large-ish web applications which use Moose heavily
and have been in production (without issue) for several months now. At
$work, we are re-writing our core offering in it. And several people on
#moose have been using it (in production) for several months now as well.
+Of course, in the end, you need to make this call yourself. If you have
+any questions or concerns, please feel free to email me, or even the list
+or just stop by #moose and ask away.
+
=head2 Is Moose just Perl 6 in Perl 5?
No. While Moose is very much inspired by Perl 6, it is not itself Perl 6.
Moose features do cost more than others. It is also the
policy of Moose to B<only charge you for the features you use>,
and to do our absolute best to not place any extra burdens on
-the execution of your code for features you are not using.
-
-Next, I will point out again that we are still in the "early
-adopter" phase, so speed it not that important yet. We are
-actually optimizing for "theoretical correctness" first, and
-we will optimize for speed later. It has been our experience
-that taking this approach allows for greater optimization
-capacity.
+the execution of your code for features you are not using. Of
+course using Moose itself does involve some overhead, but it
+is mostly compile time. At this point we do have some options
+available for getting the speed you need.
Currently we have the option of making your classes immutable
as a means of boosting speed. This will mean a larger compile
time cost, but the runtime speed increase (especially in object
-construction) is pretty signifigant.
-
-This is not all either, we are also discussing and experimenting
-with L<Module::Compile>, and the idea of compiling highly
-optimized C<.pmc> files. And we have also mapped out some core
-methods as canidates for conversion to XS.
+construction) is pretty signifigant. This is not very well
+documented yet, so please ask on the list of on #moose for more
+information.
+
+We are also discussing and experimenting with L<Module::Compile>,
+and the idea of compiling highly optimized C<.pmc> files. And
+we have also mapped out some core methods as canidates for
+conversion to XS.
=head3 When will Moose be 1.0 ready?
=head3 Why is my code taking so long to load?
-Moose has a fairly heavy compile time burden, which it
-inherits from Class::MOP. If load/compile time is a
-concern for your application, Moose may not be the
-right tool for you.
+Moose does have a compile time performance burden,
+which it inherits from Class::MOP. If load/compile
+time is a concern for your application, Moose may not
+be the right tool for you.
Although, you should note that we are exploring the
use of L<Module::Compile> to try and reduce this problem,
C<BUILD> method or possibly set C<default> values in
the attribute declaration.
-=head3 I made my class immutable, and now my (before | after | around) C<new> is not being called?
+=head3 I made my class immutable, and now my (before | after |
+ around) C<new> is not being called?
Making a I<before>, I<after> or I<around> wrap around the
C<new> method, will actually create a C<new> method within
use Scalar::Util 'blessed', 'weaken', 'reftype';
use Carp 'confess';
-our $VERSION = '0.08';
+our $VERSION = '0.09';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Method::Accessor;
use Moose::Util::TypeConstraints ();
use Carp 'confess';
use Scalar::Util 'weaken', 'blessed', 'reftype';
-our $VERSION = '0.09';
+our $VERSION = '0.10';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Method::Overriden;
use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
use base "Class::MOP::Instance";
use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Method';
use Carp 'confess';
-our $VERSION = '0.03';
+our $VERSION = '0.03';
+our $AUTHORITY = 'cpan:STEVAN';
use base 'Moose::Meta::Method',
'Class::MOP::Method::Accessor';
return '' unless $attr->has_type_constraint;
- # FIXME - remove 'unless defined($value) - constraint Undef
return sprintf <<'EOF', $value, $value, $value, $value
defined($type_constraint->(%s))
|| confess "Attribute (" . $attr->name . ") does not pass the type constraint ("
Moose::Meta::Method::Constructor - Method Meta Object for constructors
-=head1 SYNOPSIS
-
=head1 DESCRIPTION
+This is a subclass of L<Class::MOP::Method> which handles
+constructing an approprate Constructor methods. This is primarily
+used in the making of immutable metaclasses, otherwise it is
+not particularly useful.
+
=head1 METHODS
=over 4
Moose::Meta::Method::Destructor - Method Meta Object for destructors
-=head1 SYNOPSIS
-
=head1 DESCRIPTION
+This is a subclass of L<Class::MOP::Method> which handles
+constructing an approprate Destructor method. This is primarily
+used in the making of immutable metaclasses, otherwise it is
+not particularly useful.
+
=head1 METHODS
=over 4
use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
use base 'Moose::Meta::Method';
use Scalar::Util 'blessed';
use B 'svref_2object';
-our $VERSION = '0.05';
+our $VERSION = '0.06';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::Class;
use Moose::Meta::Role::Method;
=head1 DESCRIPTION
-Moose's Roles are being actively developed, please see L<Moose::Role>
-for more information. For the most part, this has no user-serviceable
-parts inside. It's API is still subject to some change (although
+Please see L<Moose::Role> for more information about roles.
+For the most part, this has no user-serviceable parts inside
+this module. It's API is still subject to some change (although
probably not that much really).
=head1 METHODS
use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.01';
+our $AUTHORITY = 'cpan:STEVAN';
use base 'Class::MOP::Method';
use Moose::Meta::Attribute;
use Moose::Util::TypeConstraints ();
-our $VERSION = '0.02';
+our $VERSION = '0.03';
+our $AUTHORITY = 'cpan:STEVAN';
__PACKAGE__->meta->add_attribute('type_coercion_map' => (
reader => 'type_coercion_map',
default => sub { [] }
));
+
__PACKAGE__->meta->add_attribute(
Moose::Meta::Attribute->new('type_constraint' => (
reader => 'type_constraint',
use Carp 'confess';
use Scalar::Util 'blessed';
-our $VERSION = '0.07';
+our $VERSION = '0.08';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::TypeConstraint::Union;
use warnings;
use metaclass;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
+our $AUTHORITY = 'cpan:STEVAN';
__PACKAGE__->meta->add_attribute('type_constraints' => (
accessor => 'type_constraints',
use Carp 'confess';
-our $VERSION = '0.07';
+our $VERSION = '0.08';
+our $AUTHORITY = 'cpan:STEVAN';
sub new {
my $class = shift;
}
sub BUILDALL {
+ # NOTE: we ask Perl if we even
+ # need to do this first, to avoid
+ # extra meta level calls
return unless $_[0]->can('BUILD');
my ($self, $params) = @_;
foreach my $method (reverse $self->meta->find_all_methods_by_name('BUILD')) {
}
sub DEMOLISHALL {
+ # NOTE: we ask Perl if we even
+ # need to do this first, to avoid
+ # extra meta level calls
return unless $_[0]->can('DEMOLISH');
my $self = shift;
foreach my $method ($self->meta->find_all_methods_by_name('DEMOLISH')) {
use Sub::Exporter;
-our $VERSION = '0.06';
+our $VERSION = '0.07';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose ();
=head1 DESCRIPTION
-Role support in Moose is coming along quite well. It's best documentation
-is still the the test suite, but it is fairly safe to assume Perl 6 style
-behavior, and then either refer to the test suite, or ask questions on
-#moose if something doesn't quite do what you expect. More complete
-documentation is planned and will be included with the next official
-(non-developer) release.
+Role support in Moose is pretty solid at this point. However, the best
+documentation is still the the test suite. It is fairly safe to assume
+Perl 6 style behavior and then either refer to the test suite, or ask
+questions on #moose if something doesn't quite do what you expect.
+
+We are planning writing some more documentation in the near future, but
+nothing is ready yet, sorry.
=head1 EXPORTED FUNCTIONS
use B 'svref_2object';
use Sub::Exporter;
-our $VERSION = '0.10';
+our $VERSION = '0.11';
+our $AUTHORITY = 'cpan:STEVAN';
use Moose::Meta::TypeConstraint;
use Moose::Meta::TypeCoercion;
=head1 DESCRIPTION
-This module provides Moose with the ability to create type contraints
-to be are used in both attribute definitions and for method argument
-validation.
+This module provides Moose with the ability to create custom type
+contraints to be used in attribute definition.
=head2 Important Caveat
yet to have been created yet, is to simply do this:
use DateTime;
- subtype 'DateTime' => as Object => where { $_->isa('DateTime') };
+ subtype 'DateTime' => as 'Object' => where { $_->isa('DateTime') };
=head2 Default Type Constraints
=item B<optimize_as>
+This can be used to define a "hand optimized" version of your
+type constraint which can be used to avoid traversing a subtype
+constraint heirarchy.
+
+B<NOTE:> You should only use this if you know what you are doing,
+all the built in types use this, so your subtypes (assuming they
+are shallow) will not likely need to use this.
+
=back
=head2 Type Coercion Constructors