X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=moose-class%2Fslides%2Findex.html;h=5e678dbccaf907ef7084fb5c5e09e1fd95ce221c;hb=5117b5b315a1fcbd6ef0cc6da27ae562d54e35d7;hp=b11b1c6cbda55add589ee139b717a76a481e2036;hpb=b59551bc92b3af33b02c0b3ffa4a2d0e1227be3d;p=gitmo%2Fmoose-presentations.git diff --git a/moose-class/slides/index.html b/moose-class/slides/index.html index b11b1c6..5e678db 100644 --- a/moose-class/slides/index.html +++ b/moose-class/slides/index.html @@ -52,7 +52,7 @@ img#me05 {top: 43px;left: 36px;}

Introduction to Moose

-

YAPC 2009

+

git://git.moose.perl.org/moose-presentations.git

@@ -940,7 +940,7 @@ sub BUILD {
-

The Object is Oqaque

+

The Object is Opaque

@@ -1187,9 +1188,10 @@ use Moose;

Exercises

# cd exercises
-$ perl bin/prove -lv t/00-prereq.t
 
-Missing anything? Install it. (see tarballs/)
+# perl bin/prove -lv t/00-prereq.t
+
+# perl install-moose (if needed)
 
 # perl bin/prove -lv t/01-classes.t
 
@@ -2818,7 +2820,6 @@ coerce 'My::DateTime',
   
 
 
-
 

Using Types with Attributes

@@ -2839,6 +2840,24 @@ has favorite_numbers => (
+

More Droppings

+ + + +
package Person;
+
+use Moose;
+use Moose::Util::TypeConstraints;
+
+subtype ...;
+
+no Moose;
+no Moose::Util::TypeConstraints;
+
+ +

Typed Methods (Low-tech)

package Person;
@@ -2859,6 +2878,7 @@ sub work {
 
     ...
 }
+

Typed Methods (High-tech)

@@ -2873,6 +2893,7 @@ sub work { ... }
+

Digression: The Type Registry

@@ -2973,6 +2994,7 @@ has transaction_history => ( is => 'rw', isa => ArrayOfInt, ); +

MooseX::Types

@@ -2995,7 +3017,7 @@ has transaction_history => (
  • One more thing to install and learn
  • Every name gets types twice (declared and then defined)
  • Still stuck with strings when referring to class or role names
  • -
  • Coercion gotcha from earlier still applies to types exported from MooseX::Types::Moose
  • +
  • Coercion gotcha from earlier still applies to types exported from MooseX::Types::Moose