From: Stevan Little Date: Tue, 16 May 2006 17:15:19 +0000 (+0000) Subject: foo X-Git-Tag: 0_09_03~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43d599e5a51777979f3a955517628739ca472936;p=gitmo%2FMoose.git foo --- diff --git a/Changes b/Changes index 7cbd5c0..e37fbd2 100644 --- a/Changes +++ b/Changes @@ -1,14 +1,17 @@ Revision history for Perl extension Moose -0.09_02 +0.09_02 Tues. May 16, 2006 * Moose - added prototypes to the exported subs + - updated docs * Moose::Role - added prototypes to the exported subs + - updated docs * Moose::Util::TypeConstraints - cleaned up prototypes for the subs + - updated docs 0.09_01 Fri. May 12, 2006 ++ DEVELOPER RELEASE ++ diff --git a/README b/README index 948f2a7..dd88170 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Moose version 0.09_01 +Moose version 0.09_02 =========================== See the individual module documentation for more information diff --git a/TODO b/TODO index 6652049..ed8d241 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,10 @@ ------------------------------------------------------------------------------- + BUGS +------------------------------------------------------------------------------- + +mst: if I do "subtype 'Foo' => as 'Bar';" I get an empty condition and it dies + +------------------------------------------------------------------------------- TODO ------------------------------------------------------------------------------- @@ -90,7 +96,7 @@ and that if this usage style is used nothing is exported to the namespace. [23:40] mst right ... [23:49] mst oh, also: method 'has' => sub { ... } could squelch the redefine warning - + ------------------------------------------------------------------------------- TO PONDER ------------------------------------------------------------------------------- diff --git a/lib/Moose.pm b/lib/Moose.pm index 8a570c9..91fe96e 100644 --- a/lib/Moose.pm +++ b/lib/Moose.pm @@ -263,10 +263,12 @@ Moose - Moose, it's the new Camel =head1 SYNOPSIS package Point; + use strict; + use warnings; use Moose; - has 'x' => (isa => 'Int', is => 'rw'); - has 'y' => (isa => 'Int', is => 'rw'); + has 'x' => (is => 'rw', isa => 'Int'); + has 'y' => (is => 'rw', isa => 'Int'); sub clear { my $self = shift; @@ -275,15 +277,17 @@ Moose - Moose, it's the new Camel } package Point3D; + use strict; + use warnings; use Moose; extends 'Point'; - has 'z' => (isa => 'Int'); + has 'z' => (is => 'rw', isa => 'Int'); after 'clear' => sub { my $self = shift; - $self->{z} = 0; + $self->z(0); }; =head1 CAVEAT @@ -321,26 +325,22 @@ programming. 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. +for B. I will be deploying Moose into production environments later +this year, and I have all intentions of using it as my de-facto class +builderfrom now on. -I will be deploying Moose into production environments later this -year, and I have all intentions of using it as my de-facto class builder -from now on. - -=head2 Is Moose just Perl 6 in perl 5? +=head2 Is Moose just Perl 6 in Perl 5? No. While Moose is very much inspired by Perl 6, it is not. Instead, it -is an OO system for Perl 5. - -I built Moose because I was tired or writing the same old boring Perl 5 -OO code, and drooling over Perl 6 OO. So instead of switching to Ruby, -I wrote Moose :) +is an OO system for Perl 5. I built Moose because I was tired or writing +the same old boring Perl 5 OO code, and drooling over Perl 6 OO. So +instead of switching to Ruby, I wrote Moose :) =head1 BUILDING CLASSES WITH MOOSE Moose makes every attempt to provide as much convience during class construction/definition, but still stay out of your way if you want -it to. Here are some of the features Moose provides: +it to. Here are a few items to note when building classes with Moose. Unless specified with C, any class which uses Moose will inherit from L. @@ -351,8 +351,6 @@ inherited from L, then this includes properly initializing all instance slots, setting defaults where approprtiate and performing any type constraint checking or coercion. -For more details, see the ever expanding L. - =head1 EXPORTED FUNCTIONS Moose will export a number of functions into the class's namespace, which @@ -374,17 +372,17 @@ actually Ces onto the class's C<@ISA>, whereas C will replace it. This is important to ensure that classes which do not have superclasses properly inherit from L. -=item B +=item B -This will apply a given set of C<@role> to the local class. Role support +This will apply a given set of C<@roles> to the local class. Role support is currently under heavy development, see L for more details. =item B This will install an attribute of a given C<$name> into the current class. -The list of C<%options> are the same as those provided by both -L and L, in addition to a -few convience ones provided by Moose which are listed below: +The list of C<%options> are the same as those provided by +L, in addition to the list below which are provided +by Moose (L to be more specific): =over 4 @@ -395,7 +393,7 @@ only). These will create either a read/write accessor or a read-only accessor respectively, using the same name as the C<$name> of the attribute. If you need more control over how your accessors are named, you can use the -I, I and I options inherited from L. +I, I and I options inherited from L. =item I $type_name> diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index e5b9e99..00a0fd9 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -198,7 +198,7 @@ can be used to simplify your own type-checking code. =head2 Slightly Less Important Caveat It is almost always a good idea to quote your type and subtype names. -This is to prevent perl from trying to create the call as an indirect +This is to prevent perl from trying to execute the call as an indirect object call. This issue only seems to come up when you have a subtype the same name as a valid class, but when the issue does arise it tends to be quite annoying to debug.