From: Stevan Little Date: Sun, 11 Mar 2007 04:17:04 +0000 (+0000) Subject: 0.18 ... pretty much ready to go X-Git-Tag: 0_19~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d44714be2bf834a2df5e42da05fb7a760145adf8;p=gitmo%2FMoose.git 0.18 ... pretty much ready to go --- diff --git a/lib/Moose.pm b/lib/Moose.pm index 1eef1ea..e5f87a5 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -16,7 +16,8 @@ package Moose; use strict; use warnings; -our $VERSION = '0.18'; +our $VERSION = '0.18'; +our $AUTHORITY = 'cpan:STEVAN'; use Scalar::Util 'blessed', 'reftype'; use Carp 'confess'; @@ -314,13 +315,19 @@ Moose is I on the prototypes and experiments I did for the Perl 6 meta-model; however Moose is B an experiment/prototype, it is for B. -=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. diff --git a/lib/Moose/Cookbook/FAQ.pod b/lib/Moose/Cookbook/FAQ.pod index 69f64a0..55fa488 100644 --- a/lib/Moose/Cookbook/FAQ.pod +++ b/lib/Moose/Cookbook/FAQ.pod @@ -38,24 +38,22 @@ First let me say that I in life is free, and that some Moose features do cost more than others. It is also the policy of Moose to B, 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, 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, +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? diff --git a/lib/Moose/Cookbook/WTF.pod b/lib/Moose/Cookbook/WTF.pod index 07f3a8e..0bbc6c3 100644 --- a/lib/Moose/Cookbook/WTF.pod +++ b/lib/Moose/Cookbook/WTF.pod @@ -11,10 +11,10 @@ Moose::Cookbook::WTF - For when things go wrong with Moose =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 to try and reduce this problem, @@ -44,7 +44,8 @@ probably do better to try and convert this to use the C method or possibly set C values in the attribute declaration. -=head3 I made my class immutable, and now my (before | after | around) C is not being called? +=head3 I made my class immutable, and now my (before | after | + around) C is not being called? Making a I, I or I wrap around the C method, will actually create a C method within diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 1cbc820..6b64bde 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -7,7 +7,8 @@ use warnings; 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 (); diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 6517877..1dc36aa 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -9,7 +9,8 @@ use Class::MOP; 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; diff --git a/lib/Moose/Meta/Instance.pm b/lib/Moose/Meta/Instance.pm index d51694f..f5c9550 100644 --- a/lib/Moose/Meta/Instance.pm +++ b/lib/Moose/Meta/Instance.pm @@ -4,7 +4,8 @@ package Moose::Meta::Instance; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.01'; +our $AUTHORITY = 'cpan:STEVAN'; use base "Class::MOP::Instance"; diff --git a/lib/Moose/Meta/Method.pm b/lib/Moose/Meta/Method.pm index fb0af14..342210b 100644 --- a/lib/Moose/Meta/Method.pm +++ b/lib/Moose/Meta/Method.pm @@ -3,7 +3,8 @@ package Moose::Meta::Method; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.01'; +our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method'; diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index ab99da0..a81b8db 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -6,7 +6,8 @@ use warnings; use Carp 'confess'; -our $VERSION = '0.03'; +our $VERSION = '0.03'; +our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::Method', 'Class::MOP::Method::Accessor'; @@ -104,7 +105,6 @@ sub _inline_check_constraint { 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 (" diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index 33ddfef..fc1715e 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -236,10 +236,13 @@ __END__ Moose::Meta::Method::Constructor - Method Meta Object for constructors -=head1 SYNOPSIS - =head1 DESCRIPTION +This is a subclass of L 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 diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index 558cbb2..df95187 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -86,10 +86,13 @@ __END__ Moose::Meta::Method::Destructor - Method Meta Object for destructors -=head1 SYNOPSIS - =head1 DESCRIPTION +This is a subclass of L 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 diff --git a/lib/Moose/Meta/Method/Overriden.pm b/lib/Moose/Meta/Method/Overriden.pm index a740f41..232a3e3 100644 --- a/lib/Moose/Meta/Method/Overriden.pm +++ b/lib/Moose/Meta/Method/Overriden.pm @@ -3,7 +3,8 @@ package Moose::Meta::Method::Overriden; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.01'; +our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::Method'; diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 9064571..3da2d89 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -9,7 +9,8 @@ use Carp 'confess'; 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; @@ -553,9 +554,9 @@ Moose::Meta::Role - The Moose Role metaclass =head1 DESCRIPTION -Moose's Roles are being actively developed, please see L -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 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 diff --git a/lib/Moose/Meta/Role/Method.pm b/lib/Moose/Meta/Role/Method.pm index 1a64c2b..8efa923 100644 --- a/lib/Moose/Meta/Role/Method.pm +++ b/lib/Moose/Meta/Role/Method.pm @@ -4,7 +4,8 @@ package Moose::Meta::Role::Method; use strict; use warnings; -our $VERSION = '0.01'; +our $VERSION = '0.01'; +our $AUTHORITY = 'cpan:STEVAN'; use base 'Class::MOP::Method'; diff --git a/lib/Moose/Meta/TypeCoercion.pm b/lib/Moose/Meta/TypeCoercion.pm index 2f7cfde..35fa726 100644 --- a/lib/Moose/Meta/TypeCoercion.pm +++ b/lib/Moose/Meta/TypeCoercion.pm @@ -10,12 +10,14 @@ use Carp 'confess'; 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', diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index f3c1c0a..0326a14 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -9,7 +9,8 @@ use Sub::Name 'subname'; use Carp 'confess'; use Scalar::Util 'blessed'; -our $VERSION = '0.07'; +our $VERSION = '0.08'; +our $AUTHORITY = 'cpan:STEVAN'; use Moose::Meta::TypeConstraint::Union; diff --git a/lib/Moose/Meta/TypeConstraint/Union.pm b/lib/Moose/Meta/TypeConstraint/Union.pm index d2074bd..0bc4014 100644 --- a/lib/Moose/Meta/TypeConstraint/Union.pm +++ b/lib/Moose/Meta/TypeConstraint/Union.pm @@ -5,7 +5,8 @@ use strict; 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', diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index f607920..b54a89a 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -9,7 +9,8 @@ use metaclass 'Moose::Meta::Class'; use Carp 'confess'; -our $VERSION = '0.07'; +our $VERSION = '0.08'; +our $AUTHORITY = 'cpan:STEVAN'; sub new { my $class = shift; @@ -28,6 +29,9 @@ sub new { } 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')) { @@ -36,6 +40,9 @@ sub BUILDALL { } 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')) { diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index dc1867f..19c66b0 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -10,7 +10,8 @@ use Sub::Name 'subname'; use Sub::Exporter; -our $VERSION = '0.06'; +our $VERSION = '0.07'; +our $AUTHORITY = 'cpan:STEVAN'; use Moose (); @@ -207,12 +208,13 @@ Moose::Role - The Moose Role =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 diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index fa582e7..74739c1 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -9,7 +9,8 @@ use Scalar::Util 'blessed'; 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; @@ -250,9 +251,8 @@ Moose::Util::TypeConstraints - Type constraint system for Moose =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 @@ -285,7 +285,7 @@ this, as well as future proof your subtypes from classes which have 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 @@ -423,6 +423,14 @@ This is just sugar for the type constraint construction syntax. =item B +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 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