From: Jesse Luehrs Date: Sat, 7 May 2011 17:56:55 +0000 (-0500) Subject: typos X-Git-Tag: 2.0003~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=61f606303f5c75a0159da75650e22f0dcd07f5be;p=gitmo%2FMoose.git typos --- diff --git a/lib/Moose/Cookbook/Basics/Recipe9.pod b/lib/Moose/Cookbook/Basics/Recipe9.pod index a6fdf36..0ebc98a 100644 --- a/lib/Moose/Cookbook/Basics/Recipe9.pod +++ b/lib/Moose/Cookbook/Basics/Recipe9.pod @@ -47,7 +47,7 @@ __END__ =head1 DESCRIPTION This Moose cookbook recipe shows how operator overloading, coercion, -and sub types can be used to mimic the human reproductive system +and subtypes can be used to mimic the human reproductive system (well, the selection of genes at least). =head1 INTRODUCTION @@ -90,7 +90,7 @@ class for each gene. has 'color' => ( is => 'ro', isa => 'bey2_color' ); -This class is trivial, We have a type constraint for the allowed +This class is trivial. We have a type constraint for the allowed colors, and a C attribute. =head2 Human::Gene::gey @@ -109,7 +109,7 @@ that the I gene allows for different colors. =head1 EYE COLOR -We could just give add four attributes (two of each gene) to the +We could just give four attributes (two of each gene) to the C class, but this is a bit messy. Instead, we'll abstract the genes into a container class, C. Then a C can have a single C attribute. @@ -139,12 +139,12 @@ that a coercion will fail if it attempts to coerce a string like "indigo", because that is not a valid color for either type of gene. As an aside, you can see that we can define several identical -attributes at once by supply an array reference of names as the first +attributes at once by supplying an array reference of names as the first argument to C. We also need a method to calculate the actual eye color that results from a set of genes. The I brown gene is dominant over both blue -and green. The I green gene dominant over blue. +and green. The I green gene is dominant over blue. sub color { my ($self) = @_; @@ -166,7 +166,7 @@ so we define a string overloading for the class: use overload '""' => \&color, fallback => 1; Finally, we need to define overloading for addition. That way we can -add together to C objects and get a new one with a +add together two C objects and get a new one with a new (genetically correct) eye color. use overload '+' => \&_overload_add, fallback => 1; @@ -192,7 +192,7 @@ new (genetically correct) eye color. return 1 + int( rand(2) ); } -When two eye color objects are added together the C<_overload_add()> +When two eye color objects are added together, the C<_overload_add()> method will be passed two C objects. These are the left and right side operands for the C<+> operator. This method returns a new C object.