<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>
<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 { $_->isa('DateTime') },
message { ... };</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(
<h1>Subtype Shortcuts - <code>duck_type</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-duck_type Car => qw( run break_down );</code></pre>
+
+duck_type Car => qw( run break_down );
+
+</code></pre>
<hr />
-<pre><code>subtype 'Car',
+<pre><code>
+subtype 'Car',
as 'Object',
where { all { $_->can($_) }
qw( run break_down ) },
<h1>Subtype Shortcuts - <code>enum</code></h1>
<pre><code>use Moose::Util::TypeConstraints;
-enum Color => qw( red blue green );</code></pre>
+
+enum Color => qw( red blue green );
+
+</code></pre>
<hr />
-<pre><code>my %ok = map { $_ => 1 }
+<pre><code>
+my %ok = map { $_ => 1 }
qw( red blue green );
subtype 'Color'
<pre><code>package Person;
<span class="highlight">my $posint =
- subtype as 'Int', where { $_ > 0 };</span>
+ subtype
+ as 'Int',
+ where { $_ > 0 };</span>
has size => (
is => 'ro',
</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>
<!--
-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