Add mention of Specio
[gitmo/moose-presentations.git] / moose-class / slides / index.html
index e0aad3c..1f2c059 100644 (file)
@@ -950,10 +950,10 @@ sub BUILD {
 <div class="slide">
   <h1>Object Construction a la Moose</h1>
 
-  <pre><code>Person-&gt;new(@_)</code></pre>
+  <pre><code>Person-&gt;new(@args)</code></pre>
 
   <ol style="margin-top: 0">
-    <li>Calls <code>Person-&gt;BUILDARGS(@_)</code> to turn <code>@_</code> into a hashref</li>
+    <li>Calls <code>Person-&gt;BUILDARGS(@args)</code> to turn <code>@args</code> into a hashref</li>
     <li>Blesses a reference</li>
     <li>Populates attributes based on the hashref from #1</li>
     <li>Calls <code>$new_object-&gt;BUILDALL($constructor_args)</code>
@@ -1032,7 +1032,7 @@ extends 'LWP';</code></pre>
         <li>No <code>DEMOLISH()</code></li>
       </ul>
     </li>
-    <li>But see <code>MooseX::NonMoose</code> for a workaround</li>
+    <li>But <code>MooseX::NonMoose</code> fixes all of this</li>
   </ul>
 </div>  
 
@@ -1234,8 +1234,6 @@ use Moose;
 
 # perl bin/prove -lv t/00-prereq.t
 
-# perl install-moose (if needed)
-
 ## Read the instructions in t/01-classes.t
 
 # perl bin/prove -lv t/01-classes.t
@@ -2017,7 +2015,7 @@ Person-&gt;new( <span class="wrong">shoes =&gt; Shoes-&gt;new</span> );</code></
   <h1>Attribute Inheritance</h1>
 
   <ul>
-    <li>By default, subclasses inherit attribute as-is</li>
+    <li>By default, subclasses inherit attributes as-is</li>
     <li>Can change attribute parameters in subclasses</li>
   </ul>
 </div>   
@@ -2602,11 +2600,15 @@ has start_date =&gt; (
   <h1>Subtype Shortcuts - <code>class_type</code></h1>
 
   <pre><code>use Moose::Util::TypeConstraints;
-class_type 'DateTime';</code></pre>
+
+class_type 'DateTime';
+
+</code></pre>
 
 <hr />
 
-<pre><code>subtype     'DateTime',
+<pre><code>
+subtype     'DateTime',
     as      'Object',
     where   { $_-&gt;isa('DateTime') },
     message { ... };</code></pre>
@@ -2616,11 +2618,15 @@ class_type 'DateTime';</code></pre>
   <h1>Subtype Shortcuts - <code>role_type</code></h1>
 
   <pre><code>use Moose::Util::TypeConstraints;
-role_type 'Printable';</code></pre>
+
+role_type 'Printable';
+
+</code></pre>
 
 <hr />
 
-<pre><code>subtype 'Printable',
+<pre><code>
+subtype 'Printable',
     as  'Object',
     where
         { Moose::Util::does_role(
@@ -2632,11 +2638,15 @@ role_type 'Printable';</code></pre>
   <h1>Subtype Shortcuts - <code>duck_type</code></h1>
 
   <pre><code>use Moose::Util::TypeConstraints;
-duck_type Car =&gt; qw( run break_down );</code></pre>
+
+duck_type Car =&gt; qw( run break_down );
+
+</code></pre>
 
 <hr />
 
-<pre><code>subtype 'Car',
+<pre><code>
+subtype 'Car',
     as      'Object',
     where   { all { $_-&gt;can($_) }
               qw( run break_down ) },
@@ -2647,11 +2657,15 @@ duck_type Car =&gt; qw( run break_down );</code></pre>
   <h1>Subtype Shortcuts - <code>enum</code></h1>
 
   <pre><code>use Moose::Util::TypeConstraints;
-enum Color =&gt; qw( red blue green );</code></pre>
+
+enum Color =&gt; qw( red blue green );
+
+</code></pre>
 
 <hr />
 
-<pre><code>my %ok = map { $_ =&gt; 1 }
+<pre><code>
+my %ok = map { $_ =&gt; 1 }
              qw( red blue green );
 
 subtype     'Color'
@@ -2666,7 +2680,9 @@ subtype     'Color'
   <pre><code>package Person;
 
 <span class="highlight">my $posint =
-    subtype as 'Int', where { $_ &gt; 0 };</span>
+    subtype
+        as 'Int',
+        where { $_ &gt; 0 };</span>
 
 has size =&gt; (
     is  =&gt; 'ro',
@@ -2946,10 +2962,21 @@ has transaction_history =&gt; (
 </div>
 
 <div class="slide">
+  <h1>Specio</h1>
+
+  <ul>
+    <li>My attempt to replace <code>MooseX::Types</code> <strong>and</strong> built-in types</li>
+    <li>Third-system effect?</li>
+    <li>Still alpha - needs some work</li>
+  </ul>
+</div>
+
+<div class="slide">
   <h1>Recommendation</h1>
 
   <ul>
-    <li>Use <code>MooseX::Types</code></li>
+    <li>Use <code>MooseX::Types</code> for now</li>
+    <li>Switch to <code>Specio</code> when it's ready?</li>
     <li>Compile time error catching and automatic namespacing are huge wins</li>
     <li>Docs from <code>Moose::Util::TypeConstraints</code> are 98% compatible with <code>MooseX::Types</code> anyway</li>
     <li>A function exported by a type library works wherever a type name would</li>
@@ -3691,7 +3718,7 @@ with HasCollection =&gt; { type =&gt; 'Int' };</code></pre>
 
 <!--
 
-Copyright 2009 David Rolsky. All Rights Reserved.
+Copyright 2009-2013 David Rolsky. All Rights Reserved.
 
 This work is licensed under a Creative Commons Attribution-Share Alike
 3.0 United States License See