perl.moose http://www.nntp.perl.org/group/perl.moose/ ... Copyright 1998-2013 perl.org Wed, 22 May 2013 11:49:21 +0000 ask@perl.org Re: Moose not adequately idiot-proof? by Chris Prather Sure, I was more commenting on the trade off as an aside and why it isn&#39;t<br/>in Moose core.<br/><br/>-Chris<br/><br/>On Monday, May 20, 2013, Darren Duncan wrote:<br/><br/>&gt; If that was just done as part of a test suite though, and not in<br/>&gt; production, the performance hit might be worth it. -- Darren Duncan<br/>&gt;<br/>&gt; On 2013.05.20 3:07 PM, Chris Prather wrote:<br/>&gt;<br/>&gt;&gt; Using the hashref directly totally circumvents moose. You would need to<br/>&gt;&gt; write<br/>&gt;&gt; something like MooseX::Globref that replaces the instance type with a<br/>&gt;&gt; restricted<br/>&gt;&gt; hash. This would seriously impact performance.<br/>&gt;&gt;<br/>&gt;&gt; -Chris<br/>&gt;&gt; &mdash;<br/>&gt;&gt; Sent from Mailbox &lt;https://bit.ly/SZvoJe&gt; for iPhone<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt; On Mon, May 20, 2013 at 5:55 PM, Sam Brain &lt;samb@stanford.edu<br/>&gt;&gt; &lt;mailto:samb@stanford.edu&gt;&gt; wrote:<br/>&gt;&gt;<br/>&gt;&gt; I have a simple application which uses Moose (example copied from<br/>&gt;&gt; Moose::Manual::MooseX pages)<br/>&gt;&gt;<br/>&gt;&gt; package User;<br/>&gt;&gt;<br/>&gt;&gt; use Moose;<br/>&gt;&gt; use MooseX::StrictConstructor;<br/>&gt;&gt; use namespace::autoclean;<br/>&gt;&gt;<br/>&gt;&gt; has &#39;name&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt;&gt; has &#39;email&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt;&gt;<br/>&gt;&gt; package main;<br/>&gt;&gt;<br/>&gt;&gt; my $bob = User-&gt;new( name =&gt; &#39;Bob&#39;, email =&gt; &#39;bob@example.com&#39; );<br/>&gt;&gt;<br/>&gt;&gt; say $bob-&gt;name; # prints &#39;Bob&#39;<br/>&gt;&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method<br/>&gt;&gt; &quot;naem&quot; ..<br/>&gt;&gt;<br/>&gt;&gt; All is good so far.<br/>&gt;&gt; Then, much later, in an Idiot Moment, I forgot my &quot;objects&quot; were Moose<br/>&gt;&gt; objects and not hashrefs, and wrote:<br/>&gt;&gt;<br/>&gt;&gt; say $bob-&gt;{name}; # prints &#39;Bob&#39; (!)<br/>&gt;&gt;<br/>&gt;&gt; say &quot;OK&quot; unless($bob-&gt;{naem}); # prints &quot;OK&quot;, gives no error!<br/>&gt;&gt;<br/>&gt;&gt; $bob-&gt;name = &quot;Robert&quot;; # dies with &quot;Can&#39;t modify non-lvalue<br/>&gt;&gt; subroutine<br/>&gt;&gt; call...&quot; - Good!<br/>&gt;&gt; $bob-&gt;{name} = &quot;Robert&quot;; # doesn&#39;t die!<br/>&gt;&gt;<br/>&gt;&gt; say $bob-&gt;name; # prints &#39;Robert&#39; (!)<br/>&gt;&gt;<br/>&gt;&gt; $bob-&gt;{naem} = &quot;Roberto&quot;;<br/>&gt;&gt;<br/>&gt;&gt; say $bob-&gt;{naem}; # prints &#39;Roberto&#39; (!)<br/>&gt;&gt;<br/>&gt;&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method<br/>&gt;&gt; &quot;naem&quot; &#39; (Whew!)<br/>&gt;&gt;<br/>&gt;&gt; say Dumper($bob); # gives:<br/>&gt;&gt; # $VAR1 = bless( {<br/>&gt;&gt; # &#39;email&#39; =&gt; &#39;bob@example.com&#39;,<br/>&gt;&gt; # &#39;naem&#39; =&gt; &#39;Roberto&#39;,<br/>&gt;&gt; # &#39;name&#39; =&gt; &#39;Robert&#39;<br/>&gt;&gt; # }, &#39;User&#39; );<br/>&gt;&gt;<br/>&gt;&gt; Now I know any software cannot be totally immune from extreme idiocy<br/>&gt;&gt; like<br/>&gt;&gt; mine, but I was surprised how quickly I got myself in trouble. Is<br/>&gt;&gt; there a<br/>&gt;&gt; MooseX::StrictSomething which could have help me avoided this? (Yes I<br/>&gt;&gt; know:<br/>&gt;&gt; &quot;more exercise of the Little Grey Cells&quot; - apart from that?)<br/>&gt;&gt;<br/>&gt;&gt; Thanks<br/>&gt;&gt;<br/>&gt;&gt; Sam Brain<br/>&gt;&gt;<br/>&gt;&gt; --<br/>&gt;&gt; Sam Brain<br/>&gt;&gt; Department of Radiation Oncology<br/>&gt;&gt; Stanford Cancer Center<br/>&gt;&gt; Phone: 650-723-6967<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;&gt;<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/05/msg2641.html Mon, 20 May 2013 23:09:45 +0000 Re: Moose not adequately idiot-proof? by Darren Duncan If that was just done as part of a test suite though, and not in production, the <br/>performance hit might be worth it. -- Darren Duncan<br/><br/>On 2013.05.20 3:07 PM, Chris Prather wrote:<br/>&gt; Using the hashref directly totally circumvents moose. You would need to write<br/>&gt; something like MooseX::Globref that replaces the instance type with a restricted<br/>&gt; hash. This would seriously impact performance.<br/>&gt;<br/>&gt; -Chris<br/>&gt; &mdash;<br/>&gt; Sent from Mailbox &lt;https://bit.ly/SZvoJe&gt; for iPhone<br/>&gt;<br/>&gt;<br/>&gt; On Mon, May 20, 2013 at 5:55 PM, Sam Brain &lt;samb@stanford.edu<br/>&gt; &lt;mailto:samb@stanford.edu&gt;&gt; wrote:<br/>&gt;<br/>&gt; I have a simple application which uses Moose (example copied from<br/>&gt; Moose::Manual::MooseX pages)<br/>&gt;<br/>&gt; package User;<br/>&gt;<br/>&gt; use Moose;<br/>&gt; use MooseX::StrictConstructor;<br/>&gt; use namespace::autoclean;<br/>&gt;<br/>&gt; has &#39;name&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt; has &#39;email&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt;<br/>&gt; package main;<br/>&gt;<br/>&gt; my $bob = User-&gt;new( name =&gt; &#39;Bob&#39;, email =&gt; &#39;bob@example.com&#39; );<br/>&gt;<br/>&gt; say $bob-&gt;name; # prints &#39;Bob&#39;<br/>&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; ..<br/>&gt;<br/>&gt; All is good so far.<br/>&gt; Then, much later, in an Idiot Moment, I forgot my &quot;objects&quot; were Moose<br/>&gt; objects and not hashrefs, and wrote:<br/>&gt;<br/>&gt; say $bob-&gt;{name}; # prints &#39;Bob&#39; (!)<br/>&gt;<br/>&gt; say &quot;OK&quot; unless($bob-&gt;{naem}); # prints &quot;OK&quot;, gives no error!<br/>&gt;<br/>&gt; $bob-&gt;name = &quot;Robert&quot;; # dies with &quot;Can&#39;t modify non-lvalue subroutine<br/>&gt; call...&quot; - Good!<br/>&gt; $bob-&gt;{name} = &quot;Robert&quot;; # doesn&#39;t die!<br/>&gt;<br/>&gt; say $bob-&gt;name; # prints &#39;Robert&#39; (!)<br/>&gt;<br/>&gt; $bob-&gt;{naem} = &quot;Roberto&quot;;<br/>&gt;<br/>&gt; say $bob-&gt;{naem}; # prints &#39;Roberto&#39; (!)<br/>&gt;<br/>&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; &#39; (Whew!)<br/>&gt;<br/>&gt; say Dumper($bob); # gives:<br/>&gt; # $VAR1 = bless( {<br/>&gt; # &#39;email&#39; =&gt; &#39;bob@example.com&#39;,<br/>&gt; # &#39;naem&#39; =&gt; &#39;Roberto&#39;,<br/>&gt; # &#39;name&#39; =&gt; &#39;Robert&#39;<br/>&gt; # }, &#39;User&#39; );<br/>&gt;<br/>&gt; Now I know any software cannot be totally immune from extreme idiocy like<br/>&gt; mine, but I was surprised how quickly I got myself in trouble. Is there a<br/>&gt; MooseX::StrictSomething which could have help me avoided this? (Yes I know:<br/>&gt; &quot;more exercise of the Little Grey Cells&quot; - apart from that?)<br/>&gt;<br/>&gt; Thanks<br/>&gt;<br/>&gt; Sam Brain<br/>&gt;<br/>&gt; --<br/>&gt; Sam Brain<br/>&gt; Department of Radiation Oncology<br/>&gt; Stanford Cancer Center<br/>&gt; Phone: 650-723-6967<br/>&gt;<br/>&gt;<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/05/msg2640.html Mon, 20 May 2013 23:07:22 +0000 Re: Moose not adequately idiot-proof? by Chris Prather Using the hashref directly totally circumvents &nbsp;moose. You would need to write something like MooseX::Globref that replaces the instance type with a restricted hash. This would seriously impact performance.<br/><br/><br/>-Chris<br/>&mdash;<br/>Sent from Mailbox for iPhone<br/><br/>On Mon, May 20, 2013 at 5:55 PM, Sam Brain &lt;samb@stanford.edu&gt; wrote:<br/><br/>&gt; I have a simple application which uses Moose (example copied from <br/>&gt; Moose::Manual::MooseX pages)<br/>&gt; package User;<br/>&gt; use Moose;<br/>&gt; use MooseX::StrictConstructor;<br/>&gt; use namespace::autoclean;<br/>&gt; has &#39;name&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt; has &#39;email&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>&gt; package main;<br/>&gt; my $bob = User-&gt;new( name =&gt; &#39;Bob&#39;, email =&gt; &#39;bob@example.com&#39; );<br/>&gt; say $bob-&gt;name; # prints &#39;Bob&#39;<br/>&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; ..<br/>&gt; All is good so far.<br/>&gt; Then, much later, in an Idiot Moment, I forgot my &quot;objects&quot; were Moose <br/>&gt; objects and not hashrefs, and wrote:<br/>&gt; say $bob-&gt;{name}; # prints &#39;Bob&#39; (!)<br/>&gt; say &quot;OK&quot; unless($bob-&gt;{naem}); # prints &quot;OK&quot;, gives no error!<br/>&gt; $bob-&gt;name = &quot;Robert&quot;; # dies with &quot;Can&#39;t modify non-lvalue subroutine <br/>&gt; call...&quot; - Good!<br/>&gt; $bob-&gt;{name} = &quot;Robert&quot;; # doesn&#39;t die!<br/>&gt; say $bob-&gt;name; # prints &#39;Robert&#39; (!)<br/>&gt; $bob-&gt;{naem} = &quot;Roberto&quot;;<br/>&gt; say $bob-&gt;{naem}; # prints &#39;Roberto&#39; (!)<br/>&gt; say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; &#39; <br/>&gt; (Whew!)<br/>&gt; say Dumper($bob); # gives:<br/>&gt; # $VAR1 = bless( {<br/>&gt; # &#39;email&#39; =&gt; &#39;bob@example.com&#39;,<br/>&gt; # &#39;naem&#39; =&gt; &#39;Roberto&#39;,<br/>&gt; # &#39;name&#39; =&gt; &#39;Robert&#39;<br/>&gt; # }, &#39;User&#39; );<br/>&gt; Now I know any software cannot be totally immune from extreme idiocy <br/>&gt; like mine, but I was surprised how quickly I got myself in trouble. Is <br/>&gt; there a MooseX::StrictSomething which could have help me avoided this? <br/>&gt; (Yes I know: &quot;more exercise of the Little Grey Cells&quot; - apart from that?)<br/>&gt; Thanks<br/>&gt; Sam Brain<br/>&gt; -- <br/>&gt; Sam Brain<br/>&gt; Department of Radiation Oncology<br/>&gt; Stanford Cancer Center<br/>&gt; Phone: 650-723-6967<br/> http://www.nntp.perl.org/group/perl.moose/2013/05/msg2639.html Mon, 20 May 2013 22:07:48 +0000 Moose not adequately idiot-proof? by Sam Brain I have a simple application which uses Moose (example copied from <br/>Moose::Manual::MooseX pages)<br/><br/>package User;<br/><br/>use Moose;<br/>use MooseX::StrictConstructor;<br/>use namespace::autoclean;<br/><br/>has &#39;name&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/>has &#39;email&#39; =&gt; (is =&gt; &#39;rw&#39;, isa =&gt; &#39;Str&#39;);<br/><br/>package main;<br/><br/>my $bob = User-&gt;new( name =&gt; &#39;Bob&#39;, email =&gt; &#39;bob@example.com&#39; );<br/><br/>say $bob-&gt;name; # prints &#39;Bob&#39;<br/>say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; ..<br/><br/>All is good so far.<br/>Then, much later, in an Idiot Moment, I forgot my &quot;objects&quot; were Moose <br/>objects and not hashrefs, and wrote:<br/><br/>say $bob-&gt;{name}; # prints &#39;Bob&#39; (!)<br/><br/>say &quot;OK&quot; unless($bob-&gt;{naem}); # prints &quot;OK&quot;, gives no error!<br/><br/>$bob-&gt;name = &quot;Robert&quot;; # dies with &quot;Can&#39;t modify non-lvalue subroutine <br/>call...&quot; - Good!<br/>$bob-&gt;{name} = &quot;Robert&quot;; # doesn&#39;t die!<br/><br/>say $bob-&gt;name; # prints &#39;Robert&#39; (!)<br/><br/>$bob-&gt;{naem} = &quot;Roberto&quot;;<br/><br/>say $bob-&gt;{naem}; # prints &#39;Roberto&#39; (!)<br/><br/>say $bob-&gt;naem; # Exits with error: &#39;Can&#39;t locate object method &quot;naem&quot; &#39; <br/>(Whew!)<br/><br/>say Dumper($bob); # gives:<br/> # $VAR1 = bless( {<br/> # &#39;email&#39; =&gt; &#39;bob@example.com&#39;,<br/> # &#39;naem&#39; =&gt; &#39;Roberto&#39;,<br/> # &#39;name&#39; =&gt; &#39;Robert&#39;<br/> # }, &#39;User&#39; );<br/><br/>Now I know any software cannot be totally immune from extreme idiocy <br/>like mine, but I was surprised how quickly I got myself in trouble. Is <br/>there a MooseX::StrictSomething which could have help me avoided this? <br/>(Yes I know: &quot;more exercise of the Little Grey Cells&quot; - apart from that?)<br/><br/>Thanks<br/><br/>Sam Brain<br/><br/>-- <br/>Sam Brain<br/>Department of Radiation Oncology<br/>Stanford Cancer Center<br/>Phone: 650-723-6967<br/><br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/05/msg2638.html Mon, 20 May 2013 21:55:25 +0000 Re: Short-circuit "before" by Chris Prather On Monday, April 29, 2013, Bill Moseley wrote:<br/><br/>&gt; On Mon, Apr 29, 2013 at 11:18 AM, Chris Prather &lt;chris@prather.org&lt;javascript:;&gt;&gt;<br/>&gt; wrote:<br/>&gt;<br/>&gt; &gt; On Mon, Apr 29, 2013 at 2:03 PM, Karen Etheridge &lt;perl@froods.org&lt;javascript:;&gt;&gt;<br/>&gt; wrote:<br/>&gt; &gt;<br/>&gt; &gt; &gt; Altneratively, you might find the augment/inner method modification<br/>&gt; &gt; pattern<br/>&gt; &gt; &gt; to be of use -- a method can always opt to not call inner() if it has<br/>&gt; had<br/>&gt; &gt; &gt; its preconditions satisfied already. (Actually, this is probably<br/>&gt; better<br/>&gt; &gt; &gt; than my first suggestion.)<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt;<br/>&gt; &gt; I&#39;m not sure augment/inner is ever the right answer, but it&#39;s certainly<br/>&gt; &gt; better than relying upon Role application order.<br/>&gt; &gt;<br/>&gt;<br/>&gt; In my case the order is not really important -- just need to find the first<br/>&gt; one that succeeds. Although, in general I could see situation where the<br/>&gt; order would be important.<br/>&gt;<br/>&gt; I&#39;m not following the code below. Do you have an array or roles brought in<br/>&gt; using &quot;with&quot;? Or instances of classes that all have an authenticate()<br/>&gt; method? What I&#39;m not understanding is how you are calling the<br/>&gt; authenticate method in each role.<br/>&gt;<br/>&gt;<br/>The roles have been translated to objects that each implement only the<br/>authentication logic that you currently have in Roles. Perhaps the type<br/>constraint is confusing things:<br/><br/>subtype AuthPlugin =&gt; as Object =&gt; where { $_-&gt;does(&#39;MyApp::AuthPlugin&#39;) };<br/> # an equivalent Type Constraint<br/><br/>which effectively is:<br/><br/>subtype AuthPlugin =&gt; as Object =&gt; where { $_-&gt;can(&#39;authenticate&#39;) }; #<br/>equivalent to a duck_type than role_type.<br/><br/>You then iterate over this list of objects, having each one try<br/>to authenticate accordingly.<br/><br/>My other thought was a parameterized role where I pass in a list of<br/>&gt; authentication classes where each has an authenticate method and then call<br/>&gt; them in a loop as you have below.<br/>&gt;<br/>&gt;<br/>You could that that yes, but in my opinion it would be serious overkill.<br/>You seem to be hung up on &quot;a solution involving Roles&quot; when really &quot;a<br/>solution involving delegates&quot; would work just as well.<br/>&gt;<br/>&gt;<br/>-Chris<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2637.html Mon, 29 Apr 2013 20:00:07 +0000 Re: Short-circuit "before" by Bill Moseley On Mon, Apr 29, 2013 at 11:18 AM, Chris Prather &lt;chris@prather.org&gt; wrote:<br/><br/>&gt; On Mon, Apr 29, 2013 at 2:03 PM, Karen Etheridge &lt;perl@froods.org&gt; wrote:<br/>&gt;<br/>&gt; &gt; Altneratively, you might find the augment/inner method modification<br/>&gt; pattern<br/>&gt; &gt; to be of use -- a method can always opt to not call inner() if it has had<br/>&gt; &gt; its preconditions satisfied already. (Actually, this is probably better<br/>&gt; &gt; than my first suggestion.)<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; I&#39;m not sure augment/inner is ever the right answer, but it&#39;s certainly<br/>&gt; better than relying upon Role application order.<br/>&gt;<br/><br/>In my case the order is not really important -- just need to find the first<br/>one that succeeds. Although, in general I could see situation where the<br/>order would be important.<br/><br/>I&#39;m not following the code below. Do you have an array or roles brought in<br/>using &quot;with&quot;? Or instances of classes that all have an authenticate()<br/>method? What I&#39;m not understanding is how you are calling the<br/>authenticate method in each role.<br/><br/>My other thought was a parameterized role where I pass in a list of<br/>authentication classes where each has an authenticate method and then call<br/>them in a loop as you have below.<br/><br/>Thanks,<br/><br/><br/>&gt;<br/>&gt; In this situation I&#39;d argue that you want an array of Authentication<br/>&gt; Objects that all do the same API-style role.<br/>&gt;<br/>&gt; role_type AuthPlugin =&gt; { role =&gt; &#39;MyApp::AuthPlugin&#39; };<br/>&gt;<br/>&gt; has auth_plugins =&gt; ( isa =&gt; &#39;ArrayRef[AuthPlugin]&#39;, traits =&gt; [&#39;Array&#39;],<br/>&gt; handles =&gt; { auth_plugins =&gt; &#39;elements&#39; });<br/>&gt;<br/>&gt; sub authenticate {<br/>&gt; my $self = shift;<br/>&gt; return if $_-&gt;authenticate(@_) for $self-&gt;auth_plugins;<br/>&gt; confess &quot;Authentication Failed&quot;<br/>&gt; }<br/>&gt;<br/>&gt; That way you can add arbitrarily many auth plugins to the list in a<br/>&gt; specific order.<br/>&gt;<br/><br/><br/><br/>-- <br/>Bill Moseley<br/>moseley@hank.org<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2636.html Mon, 29 Apr 2013 19:22:13 +0000 Re: Delete or disable a Method Modifier by Chris Prather On Mon, Apr 29, 2013 at 2:07 PM, Brian ROONEY &lt;<br/>brian.xb.rooney@stericsson.com&gt; wrote:<br/><br/>&gt; Anyone know a bit of meta or other way to delete a MM or disable a MM from<br/>&gt; firing?<br/>&gt;<br/>&gt; package Stuff;<br/>&gt;<br/>&gt; with &#39;OtherStuff&#39;; # run()<br/>&gt;<br/>&gt; after &#39;run&#39; =&gt; sub { @_[0]-&gt;check };<br/>&gt;<br/>&gt; sub check { # yadda... }<br/>&gt;<br/>&gt; __PACKAGE__-&gt;meta-&gt;make_immutable;no Moose;1;<br/>&gt;<br/>&gt;<br/>&gt; my $p = Stuff-&gt;new;<br/>&gt; # delete or disable MM so I can test check() autonomously<br/>&gt; $p-&gt;run;<br/>&gt;<br/>&gt; $p-&gt;check;<br/>&gt;<br/>&gt;<br/><br/>If this is just for testing you can add a flag to the class<br/><br/><br/>package Stuff;<br/>use Moose;<br/><br/>with &#39;OtherStuff&#39;;<br/><br/>if (!$ENV{TESTING}) {<br/> after &#39;run&#39; =&gt; sub { $_[0]-&gt;check };<br/>}<br/><br/>....<br/><br/>then when you want to disable those methods for testing just set $ENV{TEST}<br/>= 1<br/><br/>-Chris<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2635.html Mon, 29 Apr 2013 18:21:32 +0000 Re: Short-circuit "before" by Chris Prather On Mon, Apr 29, 2013 at 2:03 PM, Karen Etheridge &lt;perl@froods.org&gt; wrote:<br/><br/>&gt; On Mon, Apr 29, 2013 at 10:45:57AM -0700, Bill Moseley wrote:<br/>&gt; &gt; What we are after is somewhat of a plugin system built with Roles where a<br/>&gt; &gt; method in each Role is called in some defined order and once successful<br/>&gt; no<br/>&gt; &gt; more are run.<br/>&gt; &gt; Anyone have a better suggestion than our &quot;before authenticate&quot; approach?<br/>&gt;<br/>&gt; (in principle) roles should be able to be applied in any order and not be<br/>&gt; aware of/care about what other roles have been applied. If you need method<br/>&gt; modifiers to be aware of each other&#39;s existence, I would suggest creating<br/>&gt; an attribute (via another role, that the other roles would &#39;requires&#39; to be<br/>&gt; applied) which can share the necessary state information.<br/>&gt;<br/>&gt; Altneratively, you might find the augment/inner method modification pattern<br/>&gt; to be of use -- a method can always opt to not call inner() if it has had<br/>&gt; its preconditions satisfied already. (Actually, this is probably better<br/>&gt; than my first suggestion.)<br/>&gt;<br/>&gt;<br/>I&#39;m not sure augment/inner is ever the right answer, but it&#39;s certainly<br/>better than relying upon Role application order.<br/><br/>In this situation I&#39;d argue that you want an array of Authentication<br/>Objects that all do the same API-style role.<br/><br/>role_type AuthPlugin =&gt; { role =&gt; &#39;MyApp::AuthPlugin&#39; };<br/><br/>has auth_plugins =&gt; ( isa =&gt; &#39;ArrayRef[AuthPlugin]&#39;, traits =&gt; [&#39;Array&#39;],<br/>handles =&gt; { auth_plugins =&gt; &#39;elements&#39; });<br/><br/>sub authenticate {<br/> my $self = shift;<br/> return if $_-&gt;authenticate(@_) for $self-&gt;auth_plugins;<br/> confess &quot;Authentication Failed&quot;<br/>}<br/><br/>That way you can add arbitrarily many auth plugins to the list in a<br/>specific order.<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2634.html Mon, 29 Apr 2013 18:18:29 +0000 Delete or disable a Method Modifier by Brian ROONEY Anyone know a bit of meta or other way to delete a MM or disable a MM from firing?<br/><br/>package Stuff;<br/><br/>with &#39;OtherStuff&#39;; # run()<br/><br/>after &#39;run&#39; =&gt; sub { @_[0]-&gt;check };<br/><br/>sub check { # yadda... }<br/><br/>__PACKAGE__-&gt;meta-&gt;make_immutable;no Moose;1;<br/><br/><br/>my $p = Stuff-&gt;new;<br/># delete or disable MM so I can test check() autonomously<br/>$p-&gt;run;<br/><br/>$p-&gt;check;<br/><br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2633.html Mon, 29 Apr 2013 18:07:44 +0000 Re: Short-circuit "before" by Karen Etheridge On Mon, Apr 29, 2013 at 10:45:57AM -0700, Bill Moseley wrote:<br/>&gt; What we are after is somewhat of a plugin system built with Roles where a<br/>&gt; method in each Role is called in some defined order and once successful no<br/>&gt; more are run.<br/>&gt; Anyone have a better suggestion than our &quot;before authenticate&quot; approach?<br/><br/>(in principle) roles should be able to be applied in any order and not be<br/>aware of/care about what other roles have been applied. If you need method<br/>modifiers to be aware of each other&#39;s existence, I would suggest creating<br/>an attribute (via another role, that the other roles would &#39;requires&#39; to be<br/>applied) which can share the necessary state information.<br/><br/>Altneratively, you might find the augment/inner method modification pattern<br/>to be of use -- a method can always opt to not call inner() if it has had<br/>its preconditions satisfied already. (Actually, this is probably better<br/>than my first suggestion.)<br/><br/><br/><br/>-- <br/> Love is grand, divorce is a hundred grand.<br/> . . . . .<br/>Karen Etheridge, karen@etheridge.ca GCS C+++$ USL+++$ P+++$ w--- M++<br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2632.html Mon, 29 Apr 2013 18:03:45 +0000 Short-circuit "before" by Bill Moseley In an app we have an authenticate() method that either sets a flag that<br/>authentication was successful or throws an exception for failure to<br/>authenticate.<br/><br/>Then we wanted to add two additional ways to authenticate. We created two<br/>new roles with &quot;before authenticate&quot; method modifiers and had each one<br/>check a flag if authentication was successful (in a previous &quot;before&quot;) to<br/>decide to continue checking or not. Now we have more methods we wish to<br/>add.<br/><br/>It&#39;s feeling a bit hackish at this point.<br/><br/>What we are after is somewhat of a plugin system built with Roles where a<br/>method in each Role is called in some defined order and once successful no<br/>more are run.<br/><br/>Anyone have a better suggestion than our &quot;before authenticate&quot; approach?<br/><br/>Thanks,<br/><br/>-- <br/>Bill Moseley<br/>moseley@hank.org<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2631.html Mon, 29 Apr 2013 17:46:39 +0000 Re: MooX-late-0.009 Breaks XML-Grammar-Fiction-0.12.4 by Shlomi Fish Hi Toby (and all),<br/><br/>Please reply to all recipients.<br/><br/>I noticed that this was fixed here -<br/>https://metacpan.org/diff/release/TOBYINK/MooX-late-0.009/TOBYINK/MooX-late-0.010 .<br/><br/>However, it was fixed *without* an automated regression test. A regression test<br/>should definitely be added.<br/><br/>Regards,<br/><br/> Shlomi Fish<br/><br/>On Tue, 23 Apr 2013 15:48:36 +0300<br/>Shlomi Fish &lt;shlomif@shlomifish.org&gt; wrote:<br/><br/>&gt; <br/>&gt; <br/>&gt; Begin forwarded message:<br/>&gt; <br/>&gt; Date: Tue, 23 Apr 2013 09:50:01 +0100<br/>&gt; From: &quot;Toby Inkster&quot; &lt;mail@tobyinkster.co.uk&gt;<br/>&gt; To: &quot;Shlomi Fish&quot; &lt;shlomif@shlomifish.org&gt;<br/>&gt; Subject: Re: MooX-late-0.009 Breaks XML-Grammar-Fiction-0.12.4<br/>&gt; <br/>&gt; <br/>&gt; &gt; What should be done? Can MooX::late be fixed?<br/>&gt; <br/>&gt; Thanks. In the latest release I simplified much of the type constraint<br/>&gt; parsing, but it looks like I broke Maybe. It&#39;s treating it as a class<br/>&gt; name. That is, it thinks isa=&gt;&quot;Maybe&quot; means that you want an object<br/>&gt; blessed into the &quot;Maybe&quot; package.<br/>&gt; <br/>&gt; It should be a one line fix. I&#39;ll try to release a new version today.<br/>&gt; <br/>&gt; -Toby<br/>&gt; <br/>&gt; <br/>&gt; <br/><br/><br/><br/>-- <br/>-----------------------------------------------------------------<br/>Shlomi Fish http://www.shlomifish.org/<br/>Best Introductory Programming Language - http://shlom.in/intro-lang<br/><br/>Mastering &lsquo;cat&rsquo; is almost as difficult as herding cats.<br/> &mdash; http://www.shlomifish.org/humour/bits/Mastering-Cat/<br/><br/>Please reply to list if it&#39;s a mailing list post - http://shlom.in/reply .<br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2630.html Thu, 25 Apr 2013 08:24:51 +0000 Fw: MooX-late-0.009 Breaks XML-Grammar-Fiction-0.12.4 by Shlomi Fish <br/><br/>Begin forwarded message:<br/><br/>Date: Tue, 23 Apr 2013 09:50:01 +0100<br/>From: &quot;Toby Inkster&quot; &lt;mail@tobyinkster.co.uk&gt;<br/>To: &quot;Shlomi Fish&quot; &lt;shlomif@shlomifish.org&gt;<br/>Subject: Re: MooX-late-0.009 Breaks XML-Grammar-Fiction-0.12.4<br/><br/><br/>&gt; What should be done? Can MooX::late be fixed?<br/><br/>Thanks. In the latest release I simplified much of the type constraint<br/>parsing, but it looks like I broke Maybe. It&#39;s treating it as a class<br/>name. That is, it thinks isa=&gt;&quot;Maybe&quot; means that you want an object<br/>blessed into the &quot;Maybe&quot; package.<br/><br/>It should be a one line fix. I&#39;ll try to release a new version today.<br/><br/>-Toby<br/><br/><br/><br/>-- <br/>-----------------------------------------------------------------<br/>Shlomi Fish http://www.shlomifish.org/<br/>Buffy Factoids - http://www.shlomifish.org/humour/bits/facts/Buffy/<br/><br/>Wikipedia has a page about everything including the<br/>http://en.wikipedia.org/wiki/Kitchen_sink .<br/><br/>Please reply to list if it&#39;s a mailing list post - http://shlom.in/reply .<br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2629.html Tue, 23 Apr 2013 12:48:52 +0000 MooX-late-0.009 Breaks XML-Grammar-Fiction-0.12.4 by Shlomi Fish Hi all,<br/><br/>as can be seen here:<br/><br/>http://www.cpantesters.org/cpan/report/bad7a68b-6c66-1014-acf0-ef5eb1e9163f<br/><br/>MooX-late-0.009 breaks https://metacpan.org/release/XML-Grammar-Fiction version<br/>0.12.4 (And earlier versions). The way I see it, I&#39;m doing it according to the<br/>right Moose way, and as a result I&#39;m getting tons of error reports.<br/><br/>What should be done? Can MooX::late be fixed?<br/><br/>I&#39;m including below the error report from my local machine. If I use<br/>MooX-late-0.007 all tests are fine.<br/><br/>Regards,<br/><br/> Shlomi Fish<br/><br/>[DZ] building distribution under .build/m4dAnNX4S0 for installation<br/>[DZ] beginning to build XML-Grammar-Fiction<br/>[DZ] guessing dist&#39;s main_module is lib/XML/Grammar/Fiction.pm<br/>[VersionFromModule] dist version 0.12.4 (from lib/XML/Grammar/Fiction.pm)<br/>[DZ] extracting distribution abstract from lib/XML/Grammar/Fiction.pm<br/>[@Basic/ExtraTests] rewriting release test xt/release/pod-syntax.t<br/>[@Basic/ExtraTests] rewriting release test xt/release/pod-coverage.t<br/>[DZ] writing XML-Grammar-Fiction in .build/m4dAnNX4S0<br/>Checking if your kit is complete...<br/>Looks good<br/>Writing Makefile for XML::Grammar::Fiction<br/>Writing MYMETA.yml and MYMETA.json<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Saying.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Saying.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Description.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Description.pm<br/>cp lib/XML/Grammar/Screenplay/FromProto.pm blib/lib/XML/Grammar/Screenplay/FromProto.pm<br/>cp lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm blib/lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm<br/>cp lib/XML/Grammar/Fiction/ToHTML.pm blib/lib/XML/Grammar/Fiction/ToHTML.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Nodes.pm blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm<br/>cp lib/XML/Grammar/FictionBase/XSLT/Converter.pm blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm<br/>cp lib/XML/Grammar/Screenplay/ToTEI.pm blib/lib/XML/Grammar/Screenplay/ToTEI.pm<br/>cp lib/XML/Grammar/Screenplay/ToHTML.pm blib/lib/XML/Grammar/Screenplay/ToHTML.pm<br/>cp lib/XML/Grammar/Fiction/App/ToHTML.pm blib/lib/XML/Grammar/Fiction/App/ToHTML.pm<br/>cp lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm blib/lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm<br/>cp lib/XML/Grammar/Fiction/Struct/Tag.pm blib/lib/XML/Grammar/Fiction/Struct/Tag.pm<br/>cp lib/XML/Grammar/Fiction/ToDocBook.pm blib/lib/XML/Grammar/Fiction/ToDocBook.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm blib/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm<br/>cp lib/XML/Grammar/Screenplay/App/FromProto.pm blib/lib/XML/Grammar/Screenplay/App/FromProto.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/List.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/List.pm<br/>cp lib/XML/Grammar/Screenplay/ToDocBook.pm blib/lib/XML/Grammar/Screenplay/ToDocBook.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Text.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Text.pm<br/>cp lib/XML/Grammar/Screenplay.pm blib/lib/XML/Grammar/Screenplay.pm<br/>cp lib/XML/Grammar/Screenplay/FromProto/Parser.pm blib/lib/XML/Grammar/Screenplay/FromProto/Parser.pm<br/>cp lib/XML/Grammar/Fiction/RNG_Renderer.pm blib/lib/XML/Grammar/Fiction/RNG_Renderer.pm<br/>cp lib/XML/Grammar/FictionBase/TagsTree2XML.pm blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm<br/>cp lib/XML/Grammar/Screenplay/App/ToDocBook.pm blib/lib/XML/Grammar/Screenplay/App/ToDocBook.pm<br/>cp lib/XML/Grammar/Fiction/App/ToDocBook.pm blib/lib/XML/Grammar/Fiction/App/ToDocBook.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/InnerDesc.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/InnerDesc.pm<br/>cp lib/XML/Grammar/FictionBase/FromProto/Parser/LineIterator.pm blib/lib/XML/Grammar/FictionBase/FromProto/Parser/LineIterator.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Comment.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Comment.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/WithContent.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/WithContent.pm<br/>cp lib/XML/Grammar/Screenplay/Base.pm blib/lib/XML/Grammar/Screenplay/Base.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Element.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Element.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Parser.pm blib/lib/XML/Grammar/Fiction/FromProto/Parser.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node/Paragraph.pm blib/lib/XML/Grammar/Fiction/FromProto/Node/Paragraph.pm<br/>cp lib/XML/Grammar/Fiction/FromProto.pm blib/lib/XML/Grammar/Fiction/FromProto.pm<br/>cp lib/XML/Grammar/Screenplay/XSLT/Base.pm blib/lib/XML/Grammar/Screenplay/XSLT/Base.pm<br/>cp lib/XML/Grammar/Fiction/FromProto/Node.pm blib/lib/XML/Grammar/Fiction/FromProto/Node.pm<br/>cp lib/XML/Grammar/Fiction.pm blib/lib/XML/Grammar/Fiction.pm<br/>cp lib/XML/Grammar/Fiction/Err.pm blib/lib/XML/Grammar/Fiction/Err.pm<br/>cp lib/XML/Grammar/Fiction/App/FromProto.pm blib/lib/XML/Grammar/Fiction/App/FromProto.pm<br/>cp lib/XML/Grammar/FictionBase/Event.pm blib/lib/XML/Grammar/FictionBase/Event.pm<br/>cp lib/XML/Grammar/Screenplay/App/ToHTML.pm blib/lib/XML/Grammar/Screenplay/App/ToHTML.pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::FromProto::Parser::QnD.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::ToTEI.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::App::ToHTML.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::ToHTML.3pm<br/>Manifying blib/man3/XML::Grammar::FictionBase::FromProto::Parser::XmlIterator.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::Struct::Tag.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::ToDocBook.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Parser::QnD.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::App::FromProto.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::List.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::ToDocBook.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Text.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::FromProto::Parser.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::RNG_Renderer.3pm<br/>Manifying blib/man3/XML::Grammar::FictionBase::TagsTree2XML.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::App::ToDocBook.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::App::ToDocBook.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::InnerDesc.3pm<br/>Manifying blib/man3/XML::Grammar::FictionBase::FromProto::Parser::LineIterator.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Comment.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Saying.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::FromProto.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Description.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::ToHTML.3pm<br/>Manifying blib/man3/XML::Grammar::FictionBase::XSLT::Converter.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Nodes.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Element.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Parser.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::Err.3pm<br/>Manifying blib/man3/XML::Grammar::FictionBase::Event.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::WithContent.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::Base.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto::Node::Paragraph.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::XSLT::Base.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::FromProto.3pm<br/>Manifying blib/man3/XML::Grammar::Fiction::App::FromProto.3pm<br/>Manifying blib/man3/XML::Grammar::Screenplay::App::ToHTML.3pm<br/>PERL_DL_NONLAZY=1 /usr/bin/perl5.16.3 &quot;-MExtUtils::Command::MM&quot; &quot;-e&quot; &quot;test_harness(0, &#39;blib/lib&#39;, &#39;blib/arch&#39;)&quot; t/*.t t/base/*.t t/fiction/*.t t/screenplay/*.t<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/App/FromProto.pm line 15.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/App/FromProto.pm line 15.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::App::FromProto loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::App::FromProto ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto::Node::Element loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto::Node::Element ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto::Node::InnerDesc loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto::Node::InnerDesc ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto::Node::Paragraph loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto::Node::Paragraph ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto::Nodes loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto::Nodes ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm line 10.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::FromProto::Parser::QnD loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::FromProto::Parser::QnD ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/Struct/Tag.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/Struct/Tag.pm line 10.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Fiction::Struct::Tag loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Fiction::Struct::Tag ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/Event.pm line 6.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/Event.pm line 6.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::FictionBase::Event loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::FictionBase::Event ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/Struct/Tag.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/Struct/Tag.pm line 10.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm line 11.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm line 11.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::FictionBase::FromProto::Parser::XmlIterator loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::FictionBase::FromProto::Parser::XmlIterator ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::FictionBase::TagsTree2XML loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::FictionBase::TagsTree2XML ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at lib/XML/Grammar/Screenplay/App/FromProto.pm line 13.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Screenplay/App/FromProto.pm line 13.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Screenplay::App::FromProto loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Screenplay::App::FromProto ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Screenplay::FromProto loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Screenplay::FromProto ok)&#39;<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm line 10.<br/>BEGIN failed--compilation aborted at lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm line 10.<br/>Compilation failed in require at -e line 1.<br/><br/># Failed test &#39;XML::Grammar::Screenplay::FromProto::Parser::QnD loaded ok&#39;<br/># at t/00-compile.t line 62.<br/># &#39;&#39;<br/># doesn&#39;t match &#39;(?^s:^\s*XML::Grammar::Screenplay::FromProto::Parser::QnD ok)&#39;<br/># Looks like you failed 14 tests of 42.<br/>t/00-compile.t ........................................ <br/>Dubious, test returned 14 (wstat 3584, 0xe00)<br/>Failed 14/42 subtests <br/># <br/># <br/># Compiled against libxml2 version: 20900<br/># Running libxml2 version: 20900<br/># <br/>t/00-libxml-basic.t ................................... ok<br/>t/00-load.t ........................................... ok<br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/app-to-html.t ....................................... ok<br/>t/base/line-iterator-unit.t ........................... ok<br/>t/boilerplate.t ....................................... ok<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at t/fiction/proto-text-invalid.t line 12.<br/>BEGIN failed--compilation aborted at t/fiction/proto-text-invalid.t line 12.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/fiction/proto-text-invalid.t ........................ <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 26/26 subtests <br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at t/fiction/proto-text-to-xml-using-custom-parser.t line 13.<br/>BEGIN failed--compilation aborted at t/fiction/proto-text-to-xml-using-custom-parser.t line 13.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/fiction/proto-text-to-xml-using-custom-parser.t ..... <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 29/29 subtests <br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm line 10.<br/>Compilation failed in require at t/fiction/qnd-parser-unit.t line 6.<br/>BEGIN failed--compilation aborted at t/fiction/qnd-parser-unit.t line 6.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/fiction/qnd-parser-unit.t ........................... <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 3/3 subtests <br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/fiction/to-docbook.t ................................ ok<br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/fiction/to-xhtml.t .................................. ok<br/>t/pod-coverage.t ...................................... ok<br/>t/pod.t ............................................... ok<br/>t/release-pod-coverage.t .............................. skipped: these tests are for release candidate testing<br/>t/release-pod-syntax.t ................................ skipped: these tests are for release candidate testing<br/>t/screenplay/00-load.t ................................ ok<br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/screenplay/app-to-html.t ............................ ok<br/>t/screenplay/boilerplate.t ............................ ok<br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at t/screenplay/proto-text-invalid.t line 12.<br/>BEGIN failed--compilation aborted at t/screenplay/proto-text-invalid.t line 12.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/screenplay/proto-text-invalid.t ..................... <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 2/2 subtests <br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/TagsTree2XML.pm line 10.<br/>Compilation failed in require at /usr/lib/perl5/vendor_perl/5.16.2/Module/Runtime.pm line 317.<br/>Compilation failed in require at t/screenplay/proto-text-to-xml-using-custom-parser.t line 14.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/screenplay/proto-text-to-xml-using-custom-parser.t .. <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 54/54 subtests <br/>type &#39;Maybe&#39; does not accept parameters at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/MooX/late.pm line 246.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Fiction/FromProto/Nodes.pm line 14.<br/>Compilation failed in require at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm line 10.<br/>BEGIN failed--compilation aborted at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm line 10.<br/>Compilation failed in require at t/screenplay/qnd-parser-unit.t line 6.<br/>BEGIN failed--compilation aborted at t/screenplay/qnd-parser-unit.t line 6.<br/># Looks like your test exited with 255 before it could output anything.<br/>t/screenplay/qnd-parser-unit.t ........................ <br/>Dubious, test returned 255 (wstat 65280, 0xff00)<br/>Failed 3/3 subtests <br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/screenplay/to-docbook.t ............................. ok<br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/screenplay/to-tei.t ................................. ok<br/>Type constraint &#39;XML::LibXML::RelaxNG&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:18, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXML&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:19, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>Type constraint &#39;XML::LibXSLT::StylesheetWrapper&#39; not fully enforced (defined at /home/shlomif/progs/perl/cpan/XML/Grammar/Fiction/trunk/perl/modules/XML-Grammar-Fiction/.build/m4dAnNX4S0/blib/lib/XML/Grammar/FictionBase/XSLT/Converter.pm:20, package XML::Grammar::FictionBase::XSLT::Converter) at /home/shlomif/apps/perl/modules/lib/perl5/site_perl/5.16.3/Type/Tiny.pm line 202.<br/>t/screenplay/to-xhtml.t ............................... ok<br/>t/style-trailing-space.t .............................. ok<br/><br/>Test Summary Report<br/>-------------------<br/>t/00-compile.t (Wstat: 3584 Tests: 42 Failed: 14)<br/> Failed tests: 2, 6, 10-11, 13, 17, 19, 21, 24, 26-27<br/> 30, 34, 36<br/> Non-zero exit status: 14<br/>t/fiction/proto-text-invalid.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 26 tests but ran 0.<br/>t/fiction/proto-text-to-xml-using-custom-parser.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 29 tests but ran 0.<br/>t/fiction/qnd-parser-unit.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 3 tests but ran 0.<br/>t/screenplay/proto-text-invalid.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 2 tests but ran 0.<br/>t/screenplay/proto-text-to-xml-using-custom-parser.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 54 tests but ran 0.<br/>t/screenplay/qnd-parser-unit.t (Wstat: 65280 Tests: 0 Failed: 0)<br/> Non-zero exit status: 255<br/> Parse errors: Bad plan. You planned 3 tests but ran 0.<br/>Files=25, Tests=238, 6 wallclock secs ( 0.11 usr 0.02 sys + 5.67 cusr 0.60 csys = 6.40 CPU)<br/>Result: FAIL<br/>Failed 7/25 test programs. 14/238 subtests failed.<br/>make: *** [test_dynamic] Error 255<br/>error running make test<br/><br/><br/>-- <br/>-----------------------------------------------------------------<br/>Shlomi Fish http://www.shlomifish.org/<br/>Parody of &quot;The Fountainhead&quot; - http://shlom.in/towtf<br/><br/>If his programming is anything like his philosophising, he would find ten<br/>imaginary bugs in the &ldquo;Hello World&rdquo; program.<br/><br/>Please reply to list if it&#39;s a mailing list post - http://shlom.in/reply .<br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2628.html Tue, 23 Apr 2013 05:51:14 +0000 PDLv3 engine based on Moo[se] by Chris Marshall Hi-<br/><br/>I&#39;m new to the Moose mailing list. I&#39;ve just proposed<br/>a new implementation for the Perl Data Language<br/>computational engine based on Moo[se] and MOP.<br/><br/>I&#39;m relatively new to Moose stuff and some of my<br/>thoughts seem plausible (to me) but I would be very<br/>interested in feedback on the ideas in this proposal.<br/><br/><br/>http://mailman.jach.hawaii.edu/pipermail//pdl-porters/2013-April/005543.html<br/><br/>Thanks much,<br/>Chris<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2627.html Sun, 21 Apr 2013 22:53:50 +0000 Moose course in London by Dave Cross Hi all,<br/><br/>This Saturday (6th April) I&#39;m running a one-day course on &quot;Object <br/>Oriented Programming with Perl and Moose&quot; in London.<br/><br/>I ran a taster extract from this course at the LPW last November, but <br/>this is the full six-hour version. Tickets are &pound;30.<br/><br/>More information and a booking form are available on the Perl School <br/>web site at:<br/><br/>http://perlschool.co.uk/courses/object-oriented-programming-with-perl-and-moose/<br/><br/>It&#39;s likely, of course, that most people reading this mailing list are <br/>in no need of Moose training from me. But perhaps you could pass the <br/>details on to you less Moose-y colleagues.<br/><br/>Cheers,<br/><br/>Dave...<br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2626.html Tue, 02 Apr 2013 12:24:44 +0000 MooseX::Privacy by thiagoglauco <br/>Hi, folks.<br/>My name is Thiago and I&#39;m a Perl programmer from Brazil. I&#39;m having a very<br/>good time using MooseX::Privacy,.<br/>Afterall I&#39;m facing a little trouble, when using MooseX::Privacy inside a<br/>Moose::Role. MooseX::Privacy::Trait::Role works good with attributes but<br/>private_methods does not work inside the role. Have you even faced this<br/>issue? Is there some trick I missed?<br/><br/>thanks for your help.<br/>________________________________________<br/>Thiago Glauco Sanchez - Petrobras SA<br/>ITIL<br/>Enterasys Certified Expert - Networking<br/>Modulo Certified Security Office<br/>tel: 55 11 3523-9756 <br/>&quot;O emitente desta mensagem &#xFFFD; respons&#xFFFD;vel por seu conte&#xFFFD;do e endere&#xFFFD;amento. Cabe ao destinat&#xFFFD;rio cuidar quanto ao tratamento adequado. Sem a devida autoriza&#xFFFD;&#xFFFD;o, a divulga&#xFFFD;&#xFFFD;o, a reprodu&#xFFFD;&#xFFFD;o, a distribui&#xFFFD;&#xFFFD;o ou qualquer outra a&#xFFFD;&#xFFFD;o em desconformidade com as normas internas do Sistema Petrobras s&#xFFFD;o proibidas e pass&#xFFFD;veis de san&#xFFFD;&#xFFFD;o disciplinar, c&#xFFFD;vel e criminal.&quot;<br/> <br/>&quot;The sender of this message is responsible for its content and addressing. The receiver shall take proper care of it. Without due authorization, the publication, reproduction, distribution or the performance of any other action not conforming to Petrobras System internal policies and procedures is forbidden and liable to disciplinary, civil or criminal sanctions.&quot;<br/> <br/>&quot;El emisor de este mensaje es responsable por su contenido y direccionamiento. Cabe al destinatario darle el tratamiento adecuado. Sin la debida autorizaci&#xFFFD;n, su divulgaci&#xFFFD;n, reproducci&#xFFFD;n, distribuci&#xFFFD;n o cualquier otra acci&#xFFFD;n no conforme a las normas internas del Sistema Petrobras est&#xFFFD;n prohibidas y ser&#xFFFD;n pasibles de sanci&#xFFFD;n disciplinaria, civil y penal.&quot;<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/04/msg2625.html Tue, 02 Apr 2013 04:06:16 +0000 Re: Announcement: Moose 2.0800 is released! by Kent Fredric On 30 March 2013 08:10, Chris Prather &lt;chris@prather.org&gt; wrote:<br/>&gt; Excludes specifically (silently) encourages people to break the<br/>&gt; contract nature (allomorphism?) of Roles. That is you can suddenly no<br/>&gt; longer have an API that the Role claims you *should* have because you<br/>&gt; excluded the method on composition. Additionally the excludes/alias<br/>&gt; feature *only* exists for Roles in the core.<br/><br/>That sounds like the usage of alias/excludes should have a default<br/>stricture that they may be only used if-and-only-if doing so doesn&#39;t<br/>break the role criteria.<br/><br/>So alias/excluding &quot;foo&quot; out of the picture should add a &lt; requires<br/>foo &gt; equivalent to the role that has to be resolved at some later<br/>stage somehow.<br/><br/>at least, that way, people can use it for &quot;useful&quot; purposes without it<br/>resulting in an interface contract breach.<br/><br/>Sample Usage Might be:<br/><br/>-<br/><br/>package A;<br/>use Moose::Role;<br/><br/>sub foo { };<br/><br/>-<br/><br/>package B;<br/>use Moose::Role;<br/>with &#39;B&#39; =&gt; { excludes =&gt; [ &#39;foo&#39; ] }<br/><br/>-<br/>package C;<br/>use Moose;<br/>with &#39;B; # C must declare &#39;foo&#39;<br/><br/>-<br/><br/>Or with Aliases;<br/><br/><br/>-<br/><br/>package A;<br/>use Moose::Role;<br/><br/>sub foo { };<br/><br/>-<br/><br/>package B;<br/>use Moose::Role;<br/>with &#39;B&#39; =&gt; { alias =&gt; { &#39;foo&#39; =&gt; &#39;A_Foo&#39; } }<br/><br/>sub B_Foo { }<br/><br/>-<br/>package C;<br/>use Moose;<br/>with &#39;B; # C must declare &#39;foo&#39;<br/><br/>sub foo { $_[0]-&gt;A_Foo + $_[0]-&gt;B_Foo }<br/><br/><br/><br/><br/>-- <br/>kentnl<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2624.html Sat, 30 Mar 2013 16:27:31 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Prather On Fri, Mar 29, 2013 at 2:58 PM, Chris Weyl &lt;cweyl@alumni.drew.edu&gt; wrote:<br/>&gt;<br/>&gt; I&#39;m still not seeing any compelling reason to drop excludes/alias. Am I<br/>&gt; missing something here, like is the existence of alias/excludes in core<br/>&gt; blocking Some Thing Good, or encouraging Very Bad Behaviour?<br/><br/>The latter actually.<br/><br/>Excludes specifically (silently) encourages people to break the<br/>contract nature (allomorphism?) of Roles. That is you can suddenly no<br/>longer have an API that the Role claims you *should* have because you<br/>excluded the method on composition. Additionally the excludes/alias<br/>feature *only* exists for Roles in the core.<br/><br/>So the place we are in now is we have extra code for an inconsistent<br/>feature that can encourage bad behavior. I can see validity to the<br/>argument that this feature could be cut and replaced with either<br/>referring people like yourself to MooseX::Aliases ... or simply<br/>core-ing MX::Aliases and making the alias feature more consistent and<br/>useful.<br/><br/>Note we haven&#39;t *actually* cut anything yet. All of this is about<br/>potentially deprecating and cutting them in the future. So possibly<br/>this discussion is pre-mature too.<br/><br/>-Chris<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2623.html Fri, 29 Mar 2013 19:10:40 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Weyl On Fri, Mar 29, 2013 at 11:49 AM, Chris Prather &lt;chris@prather.org&gt; wrote:<br/><br/>&gt; On Fri, Mar 29, 2013 at 2:44 PM, Chris Weyl &lt;cweyl@alumni.drew.edu&gt; wrote:<br/>&gt; &gt; To clarify here: &quot;Aliasing allows me to trivially shunt one method aside<br/>&gt; &gt; and create a new one in its place *while still being able to use the<br/>&gt; &gt; previous method* w/o having to resort to method modifiers.&quot;<br/>&gt;<br/>&gt; To quote doy when I brought up this same point (with an entirely<br/>&gt; different phrasing) in this same thread:<br/>&gt;<br/>&gt; &gt;<br/>&gt; &gt; In that sense, there&#39;s no reason that this should be a role-specific<br/>&gt; &gt; feature, and that&#39;s why MooseX::Aliases exists to begin with.<br/>&gt;<br/><br/>The existence of a MX module that can serve the same functionality is not,<br/>in and of itself, a reason to drop core functionality. If that were the<br/>case, then we should never have included MX::AttributeHandlers in core.<br/><br/>I&#39;m still not seeing any compelling reason to drop excludes/alias. Am I<br/>missing something here, like is the existence of alias/excludes in core<br/>blocking Some Thing Good, or encouraging Very Bad Behaviour?<br/><br/> -Chris<br/><br/>-- <br/>Chris Weyl<br/>Ex astris scientia<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2622.html Fri, 29 Mar 2013 18:58:52 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Prather On Fri, Mar 29, 2013 at 2:44 PM, Chris Weyl &lt;cweyl@alumni.drew.edu&gt; wrote:<br/>&gt; On Fri, Mar 29, 2013 at 10:32 AM, Chris Weyl &lt;cweyl@alumni.drew.edu&gt; wrote:<br/>&gt;<br/>&gt;&gt; https://gist.github.com/c29c165e1aacda7018a5<br/>&gt;&gt;<br/>&gt;&gt; Aliasing allows me to trivially shunt one method aside and create a new<br/>&gt;&gt; one in its place w/o having to resort to method modifiers.<br/>&gt;&gt;<br/>&gt;<br/>&gt; To clarify here: &quot;Aliasing allows me to trivially shunt one method aside<br/>&gt; and create a new one in its place *while still being able to use the<br/>&gt; previous method* w/o having to resort to method modifiers.&quot;<br/><br/>To quote doy when I brought up this same point (with an entirely<br/>different phrasing) in this same thread:<br/><br/>&gt;<br/>&gt; In that sense, there&#39;s no reason that this should be a role-specific<br/>&gt; feature, and that&#39;s why MooseX::Aliases exists to begin with.<br/>&gt;<br/>&gt; -doy<br/><br/>-Chris<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2621.html Fri, 29 Mar 2013 18:49:23 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Weyl On Fri, Mar 29, 2013 at 10:32 AM, Chris Weyl &lt;cweyl@alumni.drew.edu&gt; wrote:<br/><br/>&gt; https://gist.github.com/c29c165e1aacda7018a5<br/>&gt;<br/>&gt; Aliasing allows me to trivially shunt one method aside and create a new<br/>&gt; one in its place w/o having to resort to method modifiers.<br/>&gt;<br/><br/>To clarify here: &quot;Aliasing allows me to trivially shunt one method aside<br/>and create a new one in its place *while still being able to use the<br/>previous method* w/o having to resort to method modifiers.&quot;<br/><br/><br/>-- <br/>Chris Weyl<br/>Ex astris scientia<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2620.html Fri, 29 Mar 2013 18:45:07 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Weyl On Fri, Mar 29, 2013 at 10:50 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/><br/>&gt; return<br/>&gt; $self-&gt;Moose::Meta::Method::Accessor::Native::Array::grep::_return_value(&quot;[<br/>&gt; keys %{ $slot_access } ]&quot;);<br/>&gt;<br/><br/>Yes, technically that would work, but.... why would hardcoding package<br/>names be better?<br/><br/> -Chris<br/><br/>-- <br/>Chris Weyl<br/>Ex astris scientia<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2619.html Fri, 29 Mar 2013 18:43:29 +0000 Re: Announcement: Moose 2.0800 is released! by Jesse Luehrs On Fri, Mar 29, 2013 at 10:32:53AM -0700, Chris Weyl wrote:<br/>&gt; On Fri, Mar 29, 2013 at 9:35 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; <br/>&gt; &gt; On Fri, Mar 29, 2013 at 09:30:59AM -0700, Chris Weyl wrote:<br/>&gt; &gt; &gt; On Thu, Mar 28, 2013 at 10:34 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; &gt; On Thu, Mar 28, 2013 at 06:23:55PM +0100, curtis_ovid_poe wrote:<br/>&gt; &gt; &gt; &gt; &gt; Is the idea of deprecating alias and excludes just speculation, or is<br/>&gt; &gt; &gt; &gt; &gt; this the plan for the future?<br/>&gt; &gt; &gt; &gt;<br/>&gt; &gt; &gt; &gt; It has always been my plan, but it&#39;s been a while since I discussed it<br/>&gt; &gt; &gt; &gt; with anyone.<br/>&gt; &gt; &gt; &gt;<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; Why would we do that? Those are extremely useful features, and I&#39;m<br/>&gt; &gt; having<br/>&gt; &gt; &gt; a hard time visualizing a benefit to removing method aliasing and<br/>&gt; &gt; exclusion.<br/>&gt; &gt;<br/>&gt; &gt; What do you use them for?<br/>&gt; &gt;<br/>&gt; <br/>&gt; One example would be an extension in providing a new native trait accessor<br/>&gt; type... (that I&#39;ve had hanging out in an attic branch forever):<br/>&gt; <br/>&gt; https://gist.github.com/c29c165e1aacda7018a5<br/>&gt; <br/>&gt; Aliasing allows me to trivially shunt one method aside and create a new one<br/>&gt; in its place w/o having to resort to method modifiers.<br/><br/>As I described earlier, this works fine:<br/><br/> package Moose::Meta::Method::Accessor::Native::Hash::grep_keys;<br/><br/> use Moose::Role 1.15;<br/><br/> with<br/> &#39;Moose::Meta::Method::Accessor::Native::Array::grep&#39;,<br/> &#39;Moose::Meta::Method::Accessor::Native::Hash&#39;,<br/> ;<br/><br/> sub _return_value {<br/> my ($self, $slot_access) = @_;<br/><br/> return $self-&gt;Moose::Meta::Method::Accessor::Native::Array::grep::_return_value(&quot;[ keys %{ $slot_access } ]&quot;);<br/> }<br/><br/> no Moose::Role;<br/><br/> 1;<br/><br/>-doy<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2618.html Fri, 29 Mar 2013 17:50:36 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Weyl On Fri, Mar 29, 2013 at 9:35 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/><br/>&gt; On Fri, Mar 29, 2013 at 09:30:59AM -0700, Chris Weyl wrote:<br/>&gt; &gt; On Thu, Mar 28, 2013 at 10:34 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; &gt;<br/>&gt; &gt; &gt; On Thu, Mar 28, 2013 at 06:23:55PM +0100, curtis_ovid_poe wrote:<br/>&gt; &gt; &gt; &gt; Is the idea of deprecating alias and excludes just speculation, or is<br/>&gt; &gt; &gt; &gt; this the plan for the future?<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; It has always been my plan, but it&#39;s been a while since I discussed it<br/>&gt; &gt; &gt; with anyone.<br/>&gt; &gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt; Why would we do that? Those are extremely useful features, and I&#39;m<br/>&gt; having<br/>&gt; &gt; a hard time visualizing a benefit to removing method aliasing and<br/>&gt; exclusion.<br/>&gt;<br/>&gt; What do you use them for?<br/>&gt;<br/><br/>One example would be an extension in providing a new native trait accessor<br/>type... (that I&#39;ve had hanging out in an attic branch forever):<br/><br/>https://gist.github.com/c29c165e1aacda7018a5<br/><br/>Aliasing allows me to trivially shunt one method aside and create a new one<br/>in its place w/o having to resort to method modifiers.<br/><br/>-- <br/>Chris Weyl<br/>Ex astris scientia<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2617.html Fri, 29 Mar 2013 17:33:22 +0000 Re: Announcement: Moose 2.0800 is released! by Jesse Luehrs On Fri, Mar 29, 2013 at 12:56:11PM -0400, Chris Prather wrote:<br/>&gt; On Fri, Mar 29, 2013 at 11:12 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; <br/>&gt; &gt;<br/>&gt; &gt; sub programmer_pay_rate { shift-&gt;R::Programmer::pay_rate }<br/>&gt; &gt;<br/>&gt; <br/>&gt; Keeping alias as a clean way of generating this exact kind of delegate<br/>&gt; might be a valid / useful thing and inline with how handles and other<br/>&gt; delegates work. It is also a much less *common* thing, and excludes<br/>&gt; has no such justification that I can see.<br/><br/>In that sense, there&#39;s no reason that this should be a role-specific<br/>feature, and that&#39;s why MooseX::Aliases exists to begin with.<br/><br/>-doy<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2616.html Fri, 29 Mar 2013 17:09:22 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Prather On Fri, Mar 29, 2013 at 11:12 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/><br/>&gt;<br/>&gt; sub programmer_pay_rate { shift-&gt;R::Programmer::pay_rate }<br/>&gt;<br/><br/>Keeping alias as a clean way of generating this exact kind of delegate<br/>might be a valid / useful thing and inline with how handles and other<br/>delegates work. It is also a much less *common* thing, and excludes<br/>has no such justification that I can see.<br/><br/>-Chris<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2615.html Fri, 29 Mar 2013 16:56:22 +0000 Re: Announcement: Moose 2.0800 is released! by Jesse Luehrs On Fri, Mar 29, 2013 at 09:30:59AM -0700, Chris Weyl wrote:<br/>&gt; On Thu, Mar 28, 2013 at 10:34 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; <br/>&gt; &gt; On Thu, Mar 28, 2013 at 06:23:55PM +0100, curtis_ovid_poe wrote:<br/>&gt; &gt; &gt; Is the idea of deprecating alias and excludes just speculation, or is<br/>&gt; &gt; &gt; this the plan for the future?<br/>&gt; &gt;<br/>&gt; &gt; It has always been my plan, but it&#39;s been a while since I discussed it<br/>&gt; &gt; with anyone.<br/>&gt; &gt;<br/>&gt; <br/>&gt; Why would we do that? Those are extremely useful features, and I&#39;m having<br/>&gt; a hard time visualizing a benefit to removing method aliasing and exclusion.<br/><br/>What do you use them for?<br/><br/>-doy<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2614.html Fri, 29 Mar 2013 16:35:55 +0000 Re: Announcement: Moose 2.0800 is released! by Chris Weyl On Thu, Mar 28, 2013 at 10:34 AM, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/><br/>&gt; On Thu, Mar 28, 2013 at 06:23:55PM +0100, curtis_ovid_poe wrote:<br/>&gt; &gt; Is the idea of deprecating alias and excludes just speculation, or is<br/>&gt; &gt; this the plan for the future?<br/>&gt;<br/>&gt; It has always been my plan, but it&#39;s been a while since I discussed it<br/>&gt; with anyone.<br/>&gt;<br/><br/>Why would we do that? Those are extremely useful features, and I&#39;m having<br/>a hard time visualizing a benefit to removing method aliasing and exclusion.<br/><br/> -Chris<br/><br/>-- <br/>Chris Weyl<br/>Ex astris scientia<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2613.html Fri, 29 Mar 2013 16:31:33 +0000 Re: Announcement: Moose 2.0800 is released! by Lars Balker On Fri, Mar 29, 2013 at 4:04 PM, Ovid &lt;curtis_ovid_poe@yahoo.com&gt; wrote:<br/>&gt;&gt;&gt; &gt; with &#39;R::Programmer&#39;;<br/>&gt;&gt;&gt; &gt; with &#39;R::Clerk&#39;;<br/><br/>&gt; I think you may have misread the code. He composed them separately because if he composed them at the same time, he would get a conflict:<br/>&gt;<br/>&gt; Due to a method name conflict in roles &#39;R::Clerk&#39; and &#39;R::Programmer&#39;,<br/>&gt; the method &#39;pay_rate&#39; must be implemented or excluded by &#39;R::Employee&#39; at ...<br/>&gt;<br/>&gt; Thus, in this instance, he was forced to compose those roles separately (since &quot;exclude&quot; is going to be taken away) and lose compositional safety.<br/><br/>I had a choice between the above and<br/><br/> with &#39;R::Programmer&#39;, &#39;R::Clerk&#39;;<br/> sub pay_rate { &quot;nonsensical return value, because the modelling is weird&quot; }<br/><br/>Both work, both are nasty.<br/>-- <br/>Lars Balker Consult::Perl<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2612.html Fri, 29 Mar 2013 15:14:57 +0000 Re: Announcement: Moose 2.0800 is released! by Jesse Luehrs On Fri, Mar 29, 2013 at 08:04:31AM -0700, Ovid wrote:<br/>&gt; ----- Original Message -----<br/>&gt; <br/>&gt; &gt; From: Jesse Luehrs &lt;doy@tozt.net&gt;<br/>&gt; &gt; On Fri, Mar 29, 2013 at 05:34:50AM -0700, Ovid wrote:<br/>&gt; &gt;&gt; ----- Original Message -----<br/>&gt; &gt;&gt; <br/>&gt; &gt;&gt; &gt; From: Lars Balker &lt;lars@balker.dk&gt;<br/>&gt; &gt;&gt; &gt; <br/>&gt; &gt;&gt; &gt; As Jesse&#39;s earlier example showed, instead of excluding and <br/>&gt; &gt; aliasing,<br/>&gt; &gt;&gt; &gt; just refer to the methods directly within the roles:<br/>&gt; &gt;&gt; &gt; <br/>&gt; &gt;&gt; &gt; use v5.10.0;<br/>&gt; &gt;&gt; &gt; { package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>&gt; &gt;&gt; &gt; { package R::Clerk;&nbsp; &nbsp; &nbsp; use Moose::Role; sub pay_rate {10} }<br/>&gt; &gt;&gt; &gt; { package R::Employee;&nbsp;&nbsp; use Moose;<br/>&gt; &gt;&gt; &gt; &nbsp; with &#39;R::Programmer&#39;;<br/>&gt; &gt;&gt; &gt; &nbsp; with &#39;R::Clerk&#39;;<br/>&gt; &gt;&gt; &gt; &nbsp; has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; <br/>&gt; &gt; );<br/>&gt; &gt;&gt; &gt; &nbsp; sub paycheck {<br/>&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; return $self-&gt;R::Programmer::pay_rate * <br/>&gt; &gt; $self-&gt;programming_hours<br/>&gt; &gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + $self-&gt;R::Clerk::pay_rate&nbsp; &nbsp; &nbsp; * $self-&gt;drudgery;<br/>&gt; &gt;&gt; &gt; &nbsp; }<br/>&gt; &gt;&gt; &gt; }<br/>&gt; &gt;&gt; &gt; my $employee = R::Employee-&gt;new(<br/>&gt; &gt;&gt; &gt; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&gt; &gt;&gt; &gt; &nbsp; &nbsp; drudgery&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 25,<br/>&gt; &gt;&gt; &gt; );<br/>&gt; &gt;&gt; &gt; say $employee-&gt;paycheck;<br/>&gt; &gt;&gt; <br/>&gt; &gt;&gt; <br/>&gt; &gt;&gt; With &#39;R::Programmer&#39; and &#39;R::Clerk&#39; composed on separate <br/>&gt; &gt; lines, you no<br/>&gt; &gt;&gt; longer get compositional safety and roles become little more than<br/>&gt; &gt;&gt; glorified mixins. These were problems that roles/traits were designed<br/>&gt; &gt;&gt; to fix. This is not an improvement.<br/>&gt; &gt; <br/>&gt; &gt; There&#39;s no need to actually compose them separately, things work just<br/>&gt; &gt; fine if you compose them on the same line.<br/>&gt; <br/>&gt; I think you may have misread the code. He composed them separately because if he composed them at the same time, he would get a conflict:<br/>&gt; <br/>&gt; &nbsp; &nbsp; Due to a method name conflict in roles &#39;R::Clerk&#39; and &#39;R::Programmer&#39;,&nbsp;<br/>&gt; &nbsp; &nbsp; the method &#39;pay_rate&#39; must be implemented or excluded by &#39;R::Employee&#39; at ...<br/>&gt; <br/>&gt; Thus, in this instance, he was forced to compose those roles<br/>&gt; separately (since &quot;exclude&quot; is going to be taken away) and lose<br/>&gt; compositional safety.<br/><br/>I did misread. In this case though, this is something that you shouldn&#39;t<br/>even be allowed to do in the first place, and the fact that Moose allows<br/>it is arguably a bug. You&#39;re consuming a role which provides a pay_rate<br/>method, but then you aren&#39;t providing a pay_rate method yourself. This<br/>entirely breaks the concept of a role interface as a contract.<br/><br/>&gt; &gt;&gt; And&nbsp;I should not have to hardcode the class names into my method<br/>&gt; &gt;&gt; names. That&#39;s a hack that we sometimes fall back on to work around MI<br/>&gt; &gt;&gt; limitations when you&#39;re trying to call an otherwise unreachable method<br/>&gt; &gt;&gt; and now it&#39;s bubbling up into roles?<br/>&gt; &gt; <br/>&gt; &gt; How is this meaningfully different? You&#39;re already hardcoding the role<br/>&gt; &gt; names at the point where you consume them.<br/>&gt; <br/>&gt; <br/>&gt; For the same reason that any cutting-and-pasting is a bad idea: our<br/>&gt; role as programmers is to minimize code duplication as much as<br/>&gt; possible to ensure that when we do have to change something, we<br/>&gt; minimize the number of places where said change needs to be made. I<br/>&gt; would much rather switch the name of the role I&#39;m using at the top of<br/>&gt; my class and know that things *just work* (again, as was part of the<br/>&gt; original intent of Smalltalk traits) instead of having to remember to<br/>&gt; do a search and replace for every place where I&#39;ve had to hard-code a<br/>&gt; package name.<br/>&gt; <br/>&gt; I could also easily see someone subclassing &quot;Employee&quot; and now having<br/>&gt; to remember that if they want pay_rate, it&#39;s<br/>&gt; either&nbsp;$self-&gt;R::Clerk::pay_rate or&nbsp;$self-&gt;R::Programmer::pay_rate .<br/>&gt; The subclass *shouldn&#39;t* have to know the implementation details of<br/>&gt; Employee to make this work. Piers&#39; solution of using<br/>&gt; &quot;*programmer_pay_rate = \&amp;R::Programmer::pay_rate is&quot; is ugly, but<br/>&gt; it&#39;s marginally better. However, that&#39;s the sort of scaffolding code<br/>&gt; that roles were (pardon the broken record) designed to handle. The<br/>&gt; tools to get this right are already in Moose, so I&#39;m really confused<br/>&gt; about what&#39;s going on here.<br/><br/>You shouldn&#39;t ever need to access the individual implementations of<br/>R::Clerk::pay_rate or R::Programmer::pay_rate except from within the<br/>role or class that composes them. Doing otherwise also defeats the<br/>purpose of a role as an interface contract. If you want to provide that<br/>information, you should write it as an actual method<br/><br/> sub programmer_pay_rate { shift-&gt;R::Programmer::pay_rate }<br/><br/>&gt; I ask again: what benefit from removing &#39;alias&#39; and &#39;exclude&#39; is so<br/>&gt; strong that it&#39;s worth removing a tool that Moose has provided for<br/>&gt; years?<br/><br/>Every example you&#39;ve given so far seems to be an abuse of the role<br/>system. I still have yet to see an example where alias or excludes is<br/>used in a way that makes sense (and as I mentioned before, I have never<br/>once had a reason to use alias or excludes except to work around the<br/>issue that is fixed in Moose 2.08).<br/><br/>-doy<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2611.html Fri, 29 Mar 2013 15:13:04 +0000 Re: Announcement: Moose 2.0800 is released! by Ovid ----- Original Message -----<br/><br/>&gt; From: Jesse Luehrs &lt;doy@tozt.net&gt;<br/>&gt; On Fri, Mar 29, 2013 at 05:34:50AM -0700, Ovid wrote:<br/>&gt;&gt; ----- Original Message -----<br/>&gt;&gt; <br/>&gt;&gt; &gt; From: Lars Balker &lt;lars@balker.dk&gt;<br/>&gt;&gt; &gt; <br/>&gt;&gt; &gt; As Jesse&#39;s earlier example showed, instead of excluding and <br/>&gt; aliasing,<br/>&gt;&gt; &gt; just refer to the methods directly within the roles:<br/>&gt;&gt; &gt; <br/>&gt;&gt; &gt; use v5.10.0;<br/>&gt;&gt; &gt; { package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>&gt;&gt; &gt; { package R::Clerk;&nbsp; &nbsp; &nbsp; use Moose::Role; sub pay_rate {10} }<br/>&gt;&gt; &gt; { package R::Employee;&nbsp;&nbsp; use Moose;<br/>&gt;&gt; &gt; &nbsp; with &#39;R::Programmer&#39;;<br/>&gt;&gt; &gt; &nbsp; with &#39;R::Clerk&#39;;<br/>&gt;&gt; &gt; &nbsp; has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; <br/>&gt; );<br/>&gt;&gt; &gt; &nbsp; sub paycheck {<br/>&gt;&gt; &gt; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&gt;&gt; &gt; &nbsp; &nbsp; &nbsp; return $self-&gt;R::Programmer::pay_rate * <br/>&gt; $self-&gt;programming_hours<br/>&gt;&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + $self-&gt;R::Clerk::pay_rate&nbsp; &nbsp; &nbsp; * $self-&gt;drudgery;<br/>&gt;&gt; &gt; &nbsp; }<br/>&gt;&gt; &gt; }<br/>&gt;&gt; &gt; my $employee = R::Employee-&gt;new(<br/>&gt;&gt; &gt; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&gt;&gt; &gt; &nbsp; &nbsp; drudgery&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 25,<br/>&gt;&gt; &gt; );<br/>&gt;&gt; &gt; say $employee-&gt;paycheck;<br/>&gt;&gt; <br/>&gt;&gt; <br/>&gt;&gt; With &#39;R::Programmer&#39; and &#39;R::Clerk&#39; composed on separate <br/>&gt; lines, you no<br/>&gt;&gt; longer get compositional safety and roles become little more than<br/>&gt;&gt; glorified mixins. These were problems that roles/traits were designed<br/>&gt;&gt; to fix. This is not an improvement.<br/>&gt; <br/>&gt; There&#39;s no need to actually compose them separately, things work just<br/>&gt; fine if you compose them on the same line.<br/><br/>I think you may have misread the code. He composed them separately because if he composed them at the same time, he would get a conflict:<br/><br/>&nbsp; &nbsp; Due to a method name conflict in roles &#39;R::Clerk&#39; and &#39;R::Programmer&#39;,&nbsp;<br/>&nbsp; &nbsp; the method &#39;pay_rate&#39; must be implemented or excluded by &#39;R::Employee&#39; at ...<br/><br/>Thus, in this instance, he was forced to compose those roles separately (since &quot;exclude&quot; is going to be taken away) and lose compositional safety.<br/>&gt;&gt; And&nbsp;I should not have to hardcode the class names into my method<br/>&gt;&gt; names. That&#39;s a hack that we sometimes fall back on to work around MI<br/>&gt;&gt; limitations when you&#39;re trying to call an otherwise unreachable method<br/>&gt;&gt; and now it&#39;s bubbling up into roles?<br/>&gt; <br/>&gt; How is this meaningfully different? You&#39;re already hardcoding the role<br/>&gt; names at the point where you consume them.<br/><br/><br/>For the same reason that any cutting-and-pasting is a bad idea: our role as programmers is to minimize code duplication as much as possible to ensure that when we do have to change something, we minimize the number of places where said change needs to be made. I would much rather switch the name of the role I&#39;m using at the top of my class and know that things *just work* (again, as was part of the original intent of Smalltalk traits) instead of having to remember to do a search and replace for every place where I&#39;ve had to hard-code a package name.<br/><br/>I could also easily see someone subclassing &quot;Employee&quot; and now having to remember that if they want pay_rate, it&#39;s either&nbsp;$self-&gt;R::Clerk::pay_rate or&nbsp;$self-&gt;R::Programmer::pay_rate . The subclass *shouldn&#39;t* have to know the implementation details of Employee to make this work. Piers&#39; solution of using &quot;*programmer_pay_rate = \&amp;R::Programmer::pay_rate is&quot; is ugly, but it&#39;s marginally better. However, that&#39;s the sort of scaffolding code that roles were (pardon the broken record) designed to handle. The tools to get this right are already in Moose, so I&#39;m really confused about what&#39;s going on here.<br/><br/>I ask again: what benefit from removing &#39;alias&#39; and &#39;exclude&#39; is so strong that it&#39;s worth removing a tool that Moose has provided for years?<br/><br/>Cheers,<br/>Ovid<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2610.html Fri, 29 Mar 2013 15:04:43 +0000 Re: Announcement: Moose 2.0800 is released! by Jesse Luehrs On Fri, Mar 29, 2013 at 05:34:50AM -0700, Ovid wrote:<br/>&gt; ----- Original Message -----<br/>&gt; <br/>&gt; &gt; From: Lars Balker &lt;lars@balker.dk&gt;<br/>&gt; &gt; <br/>&gt; &gt; As Jesse&#39;s earlier example showed, instead of excluding and aliasing,<br/>&gt; &gt; just refer to the methods directly within the roles:<br/>&gt; &gt; <br/>&gt; &gt; use v5.10.0;<br/>&gt; &gt; { package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>&gt; &gt; { package R::Clerk;&nbsp; &nbsp; &nbsp; use Moose::Role; sub pay_rate {10} }<br/>&gt; &gt; { package R::Employee;&nbsp; use Moose;<br/>&gt; &gt; &nbsp; with &#39;R::Programmer&#39;;<br/>&gt; &gt; &nbsp; with &#39;R::Clerk&#39;;<br/>&gt; &gt; &nbsp; has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&gt; &gt; &nbsp; sub paycheck {<br/>&gt; &gt; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&gt; &gt; &nbsp; &nbsp; &nbsp; return $self-&gt;R::Programmer::pay_rate * $self-&gt;programming_hours<br/>&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + $self-&gt;R::Clerk::pay_rate&nbsp; &nbsp; &nbsp; * $self-&gt;drudgery;<br/>&gt; &gt; &nbsp; }<br/>&gt; &gt; }<br/>&gt; &gt; my $employee = R::Employee-&gt;new(<br/>&gt; &gt; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&gt; &gt; &nbsp; &nbsp; drudgery&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 25,<br/>&gt; &gt; );<br/>&gt; &gt; say $employee-&gt;paycheck;<br/>&gt; <br/>&gt; <br/>&gt; With &#39;R::Programmer&#39; and &#39;R::Clerk&#39; composed on separate lines, you no<br/>&gt; longer get compositional safety and roles become little more than<br/>&gt; glorified mixins. These were problems that roles/traits were designed<br/>&gt; to fix. This is not an improvement.<br/><br/>There&#39;s no need to actually compose them separately, things work just<br/>fine if you compose them on the same line.<br/><br/>&gt; And&nbsp;I should not have to hardcode the class names into my method<br/>&gt; names. That&#39;s a hack that we sometimes fall back on to work around MI<br/>&gt; limitations when you&#39;re trying to call an otherwise unreachable method<br/>&gt; and now it&#39;s bubbling up into roles?<br/><br/>How is this meaningfully different? You&#39;re already hardcoding the role<br/>names at the point where you consume them.<br/><br/>-doy<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2609.html Fri, 29 Mar 2013 14:17:21 +0000 Re: Announcement: Moose 2.0800 is released! by Piers Cawley On 29 March 2013 09:13, Ovid &lt;curtis_ovid_poe@yahoo.com&gt; wrote:<br/>&gt; In short:<br/>&gt;<br/>&gt; 1. Allowing a role to silently override a consumed role&#39;s methods moves Perl roles even further away from Smalltalk-style traits and its associative and commutative guarantees.<br/><br/>Given that, unless you implement &#39;pay_rate&#39; in your consuming role,<br/>then &#39;with qw(R::Programmer R::Clerk)&#39; is going to blow up because you<br/>haven&#39;t resolved the conflict I&#39;m not entirely sure your claim has any<br/>validity here.<br/><br/>&gt;<br/>&gt; Regarding plans to remove &#39;alias&#39; and &#39;excludes&#39;:<br/>&gt;<br/>&gt; 2. Intending to remove the aliasing and excluding composition tools removes tools that allow finer control over how you consume your objects.<br/><br/>At the point you compose the two conflicting roles (using with<br/>qw(R::Programmer R::Clerk) you are required to resolve the conflict<br/>and, at that point, you know the fully qualified names of the methods<br/>that are in conflict, you&#39;ve got all the fine control you could<br/>desire. Yes, it&#39;s going to look ugly, what with the long names and<br/>all, but if that&#39;s _really_ a problem and excludes/alias have gone<br/>away, you still have possibilities like this open to you:<br/><br/> with qw(R::Programmer R::Clerk);<br/> *programmer_rate = *R::Programmer::pay_rate;<br/> *clerk_rate = *R::Clerk::pay_rate;<br/><br/> sub pay_rate {<br/> my $self = shift;<br/> confess &quot;Liskov Substitution Principle violation in progress&quot;<br/> or return ( $self-&gt;programmer_rate * $self-&gt;programmer_hours<br/> + $self-&gt;clerk_rate * $self-&gt;clerk_hours ) /<br/>$self-&gt;total_hours;<br/> }<br/><br/>And yes, it&#39;s horribly ugly, but your modelling here is horribly ugly<br/>too and ugly things should be ugly. And what it buys me in exchange is<br/>Roles that don&#39;t surprise me all the bloody time by not doing the the<br/>Right Thing. The new system for resolution boils down to a pretty<br/>simple mechanism:<br/><br/>When composing one more more roles into a target package then, for any<br/>given $method of those roles we apply the following logic:<br/><br/> $method_choice = $target-&gt;can($method)<br/> or do {<br/> @possibilities = map { $_-&gt;can($method) || () } @roles;<br/> confess &quot;Bad programmer, no cookie!&quot; unless @possibilities == 1;<br/> $possibilities[0];<br/> }<br/><br/>Straightforward, consistent, predictable. What&#39;s not to like?<br/><br/>This means that, in the 90% case of two roles conflicting (we want to<br/>choose the methods from one of them) we can write:<br/><br/> use (Role::Winner);<br/> use (Role::RunnerUp);<br/><br/>And in the ickier cases, we can still control how things get resolved,<br/>but the code will be icky. Because that&#39;s okay, because the sooner our<br/>bad modelling forces us to write icky code, the sooner we can realise<br/>that it&#39;s bad modelling and fix the model.<br/><br/>&gt; 3. Removing certain use cases for role composition and forcing developers to fall back on delegation is a significant performance hit.<br/><br/>Not sure I&#39;m understanding which use case has gone away.<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2608.html Fri, 29 Mar 2013 13:25:38 +0000 Re: Announcement: Moose 2.0800 is released! by Ovid ----- Original Message -----<br/><br/>&gt; From: Lars Balker &lt;lars@balker.dk&gt;<br/>&gt; <br/>&gt; As Jesse&#39;s earlier example showed, instead of excluding and aliasing,<br/>&gt; just refer to the methods directly within the roles:<br/>&gt; <br/>&gt; use v5.10.0;<br/>&gt; { package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>&gt; { package R::Clerk;&nbsp; &nbsp; &nbsp; use Moose::Role; sub pay_rate {10} }<br/>&gt; { package R::Employee;&nbsp; use Moose;<br/>&gt; &nbsp; with &#39;R::Programmer&#39;;<br/>&gt; &nbsp; with &#39;R::Clerk&#39;;<br/>&gt; &nbsp; has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&gt; &nbsp; sub paycheck {<br/>&gt; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&gt; &nbsp; &nbsp; &nbsp; return $self-&gt;R::Programmer::pay_rate * $self-&gt;programming_hours<br/>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; + $self-&gt;R::Clerk::pay_rate&nbsp; &nbsp; &nbsp; * $self-&gt;drudgery;<br/>&gt; &nbsp; }<br/>&gt; }<br/>&gt; my $employee = R::Employee-&gt;new(<br/>&gt; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&gt; &nbsp; &nbsp; drudgery&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 25,<br/>&gt; );<br/>&gt; say $employee-&gt;paycheck;<br/><br/><br/>With &#39;R::Programmer&#39; and &#39;R::Clerk&#39; composed on separate lines, you no longer get compositional safety and roles become little more than glorified mixins. These were problems that roles/traits were designed to fix. This is not an improvement.<br/><br/>And&nbsp;I should not have to hardcode the class names into my method names. That&#39;s a hack that we sometimes fall back on to work around MI limitations when you&#39;re trying to call an otherwise unreachable method and now it&#39;s bubbling up into roles?<br/><br/>&quot;alias&quot; and &quot;excludes&quot; are simple, clean ways of dealing with role composition issues that arise. They are a code smell. A code smell doesn&#39;t mean that there&#39;s defintiely a bug; it means that there may be an issue and it&#39;s worth looking at further. When another team at work writes a role that&#39;s useful in my code, I would like to simply be able to use that role and not jump through hoops because other developers have decided that alias and exclude are always bad and therefore I can&#39;t have it.<br/><br/>Rather than showing me hacks to work around the plans to deprecate these features, can someone at least make a strong argument why these features are so bad that they need to be eliminated? Preferably with code examples? Heck, even if the explanation is &quot;these features are valuable but caused many bugs inside Moose&quot;, I could at least see a rationale for this removal. Instead, this sounds dangerously close to the old problem of &quot;we need a word processor that only has the 10% of features that people actually use&quot;, but ignores the fact that different people use different subsets of behavior.<br/><br/>Regards,<br/>Ovid<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2607.html Fri, 29 Mar 2013 12:35:01 +0000 Re: Announcement: Moose 2.0800 is released! by Lars Balker On Fri, Mar 29, 2013 at 10:13 AM, Ovid &lt;curtis_ovid_poe@yahoo.com&gt; wrote:<br/>&gt; { package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>&gt; { package R::Clerk; use Moose::Role; sub pay_rate {10} }<br/>&gt; { package R::Employee; use Moose;<br/>&gt; with &#39;R::Programmer&#39; =&gt; {<br/>&gt; # this is why I want a &quot;rename&quot; property here<br/>&gt; exclude =&gt; &#39;pay_rate&#39;,<br/>&gt; alias =&gt; { pay_rate =&gt; &#39;programmer_pay_rate&#39; }<br/>&gt; },<br/>&gt; &#39;R::Clerk&#39; =&gt; {<br/>&gt; exclude =&gt; &#39;pay_rate&#39;,<br/>&gt; alias =&gt; { pay_rate =&gt; &#39;clerk_pay_rate&#39; }<br/>&gt; };<br/>&gt; has [qw/hours programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&gt; sub pay_rate {8} # ugly hack for quick example. Oops<br/>&gt;<br/>&gt; sub paycheck {<br/>&gt; my $self = shift;<br/>&gt; return $self-&gt;programmer_pay_rate * $self-&gt;programming_hours<br/>&gt; + $self-&gt;clerk_pay_rate * $self-&gt;drudgery;<br/>&gt; }<br/>&gt; }<br/>&gt; my $employee = R::Employee-&gt;new(<br/>&gt; programming_hours =&gt; 15,<br/>&gt; drudgery =&gt; 25,<br/>&gt; );<br/>&gt; say $employee-&gt;paycheck;<br/><br/>As Jesse&#39;s earlier example showed, instead of excluding and aliasing,<br/>just refer to the methods directly within the roles:<br/><br/>use v5.10.0;<br/>{ package R::Programmer; use Moose::Role; sub pay_rate {12} }<br/>{ package R::Clerk; use Moose::Role; sub pay_rate {10} }<br/>{ package R::Employee; use Moose;<br/> with &#39;R::Programmer&#39;;<br/> with &#39;R::Clerk&#39;;<br/> has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/> sub paycheck {<br/> my $self = shift;<br/> return $self-&gt;R::Programmer::pay_rate * $self-&gt;programming_hours<br/> + $self-&gt;R::Clerk::pay_rate * $self-&gt;drudgery;<br/> }<br/>}<br/>my $employee = R::Employee-&gt;new(<br/> programming_hours =&gt; 15,<br/> drudgery =&gt; 25,<br/>);<br/>say $employee-&gt;paycheck;<br/><br/>--<br/>Lars Balker Consult::Perl<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2606.html Fri, 29 Mar 2013 11:56:40 +0000 Re: Announcement: Moose 2.0800 is released! by Ovid &gt; From: Jesse Luehrs &lt;doy@tozt.net&gt;<br/><br/><br/>&gt;No, overriding is a perfectly valid way to resolve conflicts, and always<br/>&gt;has been. alias and excludes are only important to fix cases where this<br/>&gt;isn&#39;t possible, and this change should remove the last of those.<br/><br/><br/>So I can avoid spamming the list regarding things already hashed out, can you point me to the prior discussions where this change was decided? I&#39;m hoping to better understand other&#39;s thinking on this (I&#39;ve discussed this with mst, but I don&#39;t think it would be fair to assume that his opinions apply to everyone else).<br/><br/>My concern about removing &quot;alias&quot; and &quot;excludes&quot; stems in part from how I appear to have a slightly different philosophy about OO programming. I view objects as experts about solving a given problem, but the underlying object is composed of &quot;legos&quot; of roles. Need some new behavior? I rummage around in my toy box looking for the legos to snap onto my existing object. Viewing each object as a collection of well-defined behaviors rather than &quot;how can I squeeze this into a tree or graph&nbsp;hierarchy&quot; lets me just get things done, though I realize I may be in the minority here.<br/><br/>For example, in my first programming job, I worked several hours a week as a programmer and the rest of the week I was a glorified clerk. I was (illegally) paid at different rates for each job. So the &quot;employee&quot; sometimes behaves as a clerk and sometimes behaves as a programmer. Calculating my pay with roles is fairly straightforward (funky formatting to make it easier to fit in the email):<br/><br/>&nbsp; &nbsp; { package R::Programmer; use Moose::Role; sub pay_rate {12} } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br/>&nbsp; &nbsp; { package R::Clerk; &nbsp; &nbsp; &nbsp;use Moose::Role; sub pay_rate {10} }<br/>&nbsp; &nbsp; { package R::Employee; &nbsp; use Moose;<br/>&nbsp; &nbsp; &nbsp; &nbsp; with &#39;R::Programmer&#39; =&gt; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # this is why I want a &quot;rename&quot; property here<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exclude =&gt; &#39;pay_rate&#39;,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alias &nbsp; =&gt; { pay_rate =&gt; &#39;programmer_pay_rate&#39; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#39;R::Clerk&#39; =&gt; {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exclude =&gt; &#39;pay_rate&#39;,<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alias &nbsp; =&gt; { pay_rate =&gt; &#39;clerk_pay_rate&#39; }<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };<br/>&nbsp; &nbsp; &nbsp; &nbsp; has [qw/hours programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&nbsp; &nbsp; &nbsp; &nbsp; sub pay_rate {8} # ugly hack for quick example. Oops<br/><br/>&nbsp; &nbsp; &nbsp; &nbsp; sub paycheck {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $self-&gt;programmer_pay_rate * $self-&gt;programming_hours<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ $self-&gt;clerk_pay_rate &nbsp; &nbsp; &nbsp;* $self-&gt;drudgery; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; }<br/>&nbsp; &nbsp; my $employee = R::Employee-&gt;new(<br/>&nbsp; &nbsp; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&nbsp; &nbsp; &nbsp; &nbsp; drudgery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; 25,<br/>&nbsp; &nbsp; );<br/>&nbsp; &nbsp; say $employee-&gt;paycheck;<br/><br/>(yes, there&#39;s some cruft in this quickly hacked together example and it&#39;s deliberately kept simple (e.g., pay_rate) to focus on the role composition issue)<br/><br/>How do I do that without roles? I&#39;m not going to fall back on MI because that introduces the very problems that roles were trying to solve! Thus, delegation seems to be the trick (if I&#39;m creating a straw man argument here, my apologies. Please correct me). Here&#39;s the first pass at that:<br/><br/>&nbsp; &nbsp; { &nbsp; package R::Paycheck; use Moose::Role; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br/>&nbsp; &nbsp; &nbsp; &nbsp; requires &#39;pay_rate&#39;;<br/>&nbsp; &nbsp; &nbsp; &nbsp; has [qw/hours_worked/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&nbsp; &nbsp; &nbsp; &nbsp; sub paycheck {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $self-&gt;hours_worked * $self-&gt;pay_rate;<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; }<br/>&nbsp; &nbsp; { package C::Programmer; use Moose; with &#39;R::Paycheck&#39;; sub pay_rate { 12 } }<br/>&nbsp; &nbsp; { package C::Clerk; &nbsp; &nbsp; &nbsp;use Moose; with &#39;R::Paycheck&#39;; sub pay_rate { 10 } }<br/>&nbsp; &nbsp; { package C::Employee; use Moose;<br/>&nbsp; &nbsp; &nbsp; &nbsp; has [qw/programming_hours drudgery/] =&gt; ( is =&gt; &#39;ro&#39; );<br/>&nbsp; &nbsp; &nbsp; &nbsp; has &#39;programmer&#39; =&gt; ( is =&gt; &#39;ro&#39;, lazy =&gt; 1, builder =&gt; &#39;_build_programmer&#39; );<br/>&nbsp; &nbsp; &nbsp; &nbsp; has &#39;clerk&#39; &nbsp; &nbsp; &nbsp;=&gt; ( is =&gt; &#39;ro&#39;, lazy =&gt; 1, builder =&gt; &#39;_build_clerk&#39; );<br/><br/>&nbsp; &nbsp; &nbsp; &nbsp; sub _build_programmer {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C::Programmer-&gt;new( hours_worked =&gt; $self-&gt;programming_hours );<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/><br/>&nbsp; &nbsp; &nbsp; &nbsp; sub _build_clerk {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C::Clerk-&gt;new( hours_worked =&gt; $self-&gt;drudgery );<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/><br/>&nbsp; &nbsp; &nbsp; &nbsp; sub paycheck {<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $self = shift;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $self-&gt;programmer-&gt;paycheck + $self-&gt;clerk-&gt;paycheck;<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; }<br/><br/>In some respects it&#39;s cleaner, but in other respects, it&#39;s not. For example, many of my roles are things that shouldn&#39;t necessarily be instantiated on their own (Serializable), but if I&#39;m forced to use delegation for composition because I don&#39;t have exclusion and aliasing, then sometimes I&#39;m going to have to fall back on the old hack of creating classes to add some behavior, even if the &quot;class&quot; shouldn&#39;t really be a class. (See also:&nbsp;http://steve-yegge.blogspot.fr/2006/03/execution-in-kingdom-of-nouns.html).<br/>Further, while I realize my &quot;lego&quot; approach to building classes isn&#39;t to everyone&#39;s tastes, it does tend to shake out bugs in role implementations very quickly. For example, I&#39;ve had to give up on Moo because its roles are so buggy (https://rt.cpan.org/Public/Bug/Display.html?id=82711). So unless there&#39;s a really concrete, demonstrable problem with aliasing and excluding, I&#39;m very concerned about taking away these tools that have been in my toolbox for many years.<br/><br/>Finally, we can consider performance. When a role&#39;s methods are flattened into my class, they&#39;re going to be faster than delegation.&nbsp;<br/><br/><br/>&nbsp; &nbsp; use Benchmark; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br/>&nbsp; &nbsp; my %args = (<br/>&nbsp; &nbsp; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&nbsp; &nbsp; &nbsp; &nbsp; drudgery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; 25,<br/>&nbsp; &nbsp; );<br/>&nbsp; &nbsp; timethese(<br/>&nbsp; &nbsp; &nbsp; &nbsp; 100000,<br/>&nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; roles &nbsp; =&gt; sub { R::Employee-&gt;new(%args)-&gt;paycheck },<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classes =&gt; sub { C::Employee-&gt;new(%args)-&gt;paycheck },<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; );<br/><br/>In this example, we see that roles are more than twice as fast as delegation:<br/><br/>&nbsp; &nbsp; Benchmark: timing 100000 iterations of classes, roles...<br/>&nbsp; &nbsp; &nbsp; &nbsp;classes: 14 wallclock secs (14.20 usr + &nbsp;0.00 sys = 14.20 CPU) @ 7042.25/s (n=100000)<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;roles: &nbsp;6 wallclock secs ( 5.63 usr + &nbsp;0.00 sys = &nbsp;5.63 CPU) @ 17761.99/s (n=100000)<br/><br/>As it turns out, object creation is very expensive, so if we skip that part and just call the salary method (and we&#39;ll bump this up to one million iterations):<br/><br/>&nbsp; &nbsp; use Benchmark;<br/>&nbsp; &nbsp; my %args = (<br/>&nbsp; &nbsp; &nbsp; &nbsp; programming_hours =&gt; 15,<br/>&nbsp; &nbsp; &nbsp; &nbsp; drudgery &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&gt; 25,<br/>&nbsp; &nbsp; );<br/>&nbsp; &nbsp; my $roles &nbsp; = R::Employee-&gt;new(%args);<br/>&nbsp; &nbsp; my $classes = C::Employee-&gt;new(%args);<br/>&nbsp; &nbsp; timethese(<br/>&nbsp; &nbsp; &nbsp; &nbsp; 1000000, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br/>&nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; roles &nbsp; =&gt; sub { $roles-&gt;paycheck },<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classes =&gt; sub { $classes-&gt;paycheck },<br/>&nbsp; &nbsp; &nbsp; &nbsp; }<br/>&nbsp; &nbsp; );<br/><br/>&nbsp; &nbsp; Benchmark: timing 1000000 iterations of classes, roles...<br/>&nbsp; &nbsp; &nbsp; &nbsp;classes: &nbsp;3 wallclock secs ( 2.88 usr + &nbsp;0.00 sys = &nbsp;2.88 CPU) @ 347222.22/s (n=1000000)<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;roles: &nbsp;0 wallclock secs ( 1.28 usr + &nbsp;0.00 sys = &nbsp;1.28 CPU) @ 781250.00/s (n=1000000)<br/><br/>We still see the roles as slightly twice as fast as delegation.<br/><br/>In short:<br/><br/>1. Allowing a role to silently override a consumed role&#39;s methods moves Perl roles even further away from Smalltalk-style traits and its associative and commutative guarantees.<br/><br/>Regarding plans to remove &#39;alias&#39; and &#39;excludes&#39;:<br/><br/>2. Intending to remove the aliasing and excluding composition tools removes tools that allow finer control over how you consume your objects.<br/>3. Removing certain use cases for role composition and forcing developers to fall back on delegation is a significant performance hit.<br/><br/>Cheers,<br/>Ovid--<br/>Twitter -&nbsp;http://twitter.com/OvidPerl/<br/>Buy my book -&nbsp;http://bit.ly/beginning_perl<br/>Buy my other book -&nbsp;http://www.oreilly.com/catalog/perlhks/<br/>Live and work overseas -&nbsp;http://www.overseas-exile.com/<br/><br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2605.html Fri, 29 Mar 2013 09:13:17 +0000 Re: Moose 2.0801 coming up soon by Karen Etheridge On Thu, Mar 28, 2013 at 02:16:59PM -0700, Karen Etheridge wrote:<br/>&gt; ...a 2.0801 fix will be coming up shortly (by end of day, UTC-0700) --<br/>&gt; involving either a fix, or a reversion of this change.<br/><br/>Now available at a mirror near you:<br/><br/>http://metacpan.org/release/ETHER/Moose-2.0801<br/><br/>sorry again!<br/><br/><br/>-- <br/> you forth love if honk then<br/> . . . . .<br/>Karen Etheridge, karen@etheridge.ca GCS C+++$ USL+++$ P+++$ w--- M++<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2604.html Thu, 28 Mar 2013 22:04:16 +0000 Moose 2.0801 coming up soon by Karen Etheridge <br/>Unfortunately, a few issues in some Moose extensions have been found with<br/>the latest release, and since<br/><br/>**** this breaks some Catalyst installations ****<br/><br/>...a 2.0801 fix will be coming up shortly (by end of day, UTC-0700) --<br/>involving either a fix, or a reversion of this change.<br/><br/>(FWIW, it doesn&#39;t seem to be caused by the role application change being<br/>discussed.)<br/><br/>I am very sorry for the inconvenience!<br/><br/><br/>-- <br/> The only person who ever got his work done by Friday was Robinson Crusoe.<br/> . . . . .<br/>Karen Etheridge, karen@etheridge.ca GCS C+++$ USL+++$ P+++$ w--- M++<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2603.html Thu, 28 Mar 2013 21:17:22 +0000 Re: Announcement: Moose 2.0800 is released! by Piers Cawley On 28 March 2013 17:45, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt; On Thu, Mar 28, 2013 at 05:42:18PM +0000, Piers Cawley wrote:<br/>&gt;&gt; On 28 March 2013 17:36, Piers Cawley &lt;pdcawley@bofh.org.uk&gt; wrote:<br/>&gt;&gt; &gt; On 28 March 2013 16:41, Jesse Luehrs &lt;doy@tozt.net&gt; wrote:<br/>&gt;&gt; &gt;&gt; On Thu, Mar 28, 2013 at 09:20:55AM -0700, Ovid wrote:<br/>&gt;&gt; &gt;&gt;&gt; Ouch! You&#39;re right. My apologies for the confusion. The examples should be this:<br/>&gt;&gt; &gt;&gt;&gt;<br/>&gt;&gt; &gt;&gt;&gt; use 5.01000;<br/>&gt;&gt; &gt;&gt;&gt; { package a; use Moose::Role; sub result { &#39;a&#39; } }<br/>&gt;&gt; &gt;&gt;&gt; { package b; use Moose::Role; }<br/>&gt;&gt; &gt;&gt;&gt; { package c; use Moose::Role; with qw(a b); sub result { &#39;c&#39; } }<br/>&gt;&gt; &gt;&gt;&gt; { package d; use Moose::Role; with qw(c); }<br/>&gt;&gt; &gt;&gt;&gt; {<br/>&gt;&gt; &gt;&gt;&gt; package Consumer; use Moose;<br/>&gt;&gt; &gt;&gt;&gt; with &#39;d&#39;;<br/>&gt;&gt; &gt;&gt;&gt; }<br/>&gt;&gt; &gt;&gt;&gt; say Consumer-&gt;new-&gt;result;<br/>&gt;&gt; &gt;&gt;&gt;<br/>&gt;&gt; &gt;&gt;&gt; Versus:<br/>&gt;&gt; &gt;&gt;&gt;<br/>&gt;&gt; &gt;&gt;&gt; use 5.01000;<br/>&gt;&gt; &gt;&gt;&gt; { package a; use Moose::Role; with qw(b c); sub result { &#39;a&#39; } }<br/>&gt;&gt; &gt;&gt;&gt; { package b; use Moose::Role; }<br/>&gt;&gt; &gt;&gt;&gt; { package c; use Moose::Role; sub result { &#39;c&#39; } }<br/>&gt;&gt; &gt;&gt;&gt; { package d; use Moose::Role; with qw(a); }<br/>&gt;&gt; &gt;&gt;&gt; {<br/>&gt;&gt; &gt;&gt;&gt; package Consumer; use Moose;<br/>&gt;&gt; &gt;&gt;&gt; with &#39;d&#39;;<br/>&gt;&gt; &gt;&gt;&gt; }<br/>&gt;&gt; &gt;&gt;&gt; say Consumer-&gt;new-&gt;result;<br/>&gt;&gt; &gt;&gt;&gt;<br/>&gt;&gt; &gt;&gt;&gt; Only the order of role consumption is changed, but the behavior is now different.<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; I can&#39;t really agree here that &quot;only the order of role consumption is<br/>&gt;&gt; &gt;&gt; changed&quot;. I certainly wouldn&#39;t have the expectation that those two code<br/>&gt;&gt; &gt;&gt; snippets would necessarily produce the same result. The reason for this<br/>&gt;&gt; &gt;&gt; change is to bring role composition in roles into line with how role<br/>&gt;&gt; &gt;&gt; composition in classes works. For instance, here:<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; package a; use Moose::Role; sub result { &#39;a&#39; }<br/>&gt;&gt; &gt;&gt; package b; use Moose; sub result { &#39;b&#39; }<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; This has always worked without error. On the other hand, this:<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; package a; use Moose::Role; sub result { &#39;a&#39; }<br/>&gt;&gt; &gt;&gt; package b; use Moose::Role; sub result { &#39;b&#39; }<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; has historically been a conflict error, and one that has bit me (and<br/>&gt;&gt; &gt;&gt; several other people) on several occasions. I have never meant anything<br/>&gt;&gt; &gt;&gt; other than the behavior that happens in the class case, so I don&#39;t see<br/>&gt;&gt; &gt;&gt; why extending that behavior to the role case is a problem. (Or is it<br/>&gt;&gt; &gt;&gt; your opinion that the first snippet there should also be a conflict?)<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; In general, I can&#39;t really understand why the behavior for roles and<br/>&gt;&gt; &gt;&gt; classes should be different in this sense. A role consuming another role<br/>&gt;&gt; &gt;&gt; is a different operation from role summation, and one that I think<br/>&gt;&gt; &gt;&gt; should behave more similarly to a class consuming a role. Note that this<br/>&gt;&gt; &gt;&gt; is still a conflict:<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; { package a; use Moose::Role; sub result { &#39;a&#39; } }<br/>&gt;&gt; &gt;&gt; { package b; use Moose::Role; }<br/>&gt;&gt; &gt;&gt; { package c; use Moose::Role; sub result { &#39;c&#39; } }<br/>&gt;&gt; &gt;&gt; { package d; use Moose::Role; with qw(a b c); }<br/>&gt;&gt; &gt;&gt;<br/>&gt;&gt; &gt;&gt; The other benefit here is that with this change, alias and excludes<br/>&gt;&gt; &gt;&gt; become completely unnecessary, and can hopefully be deprecated.<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; Whoah! What? So when I want to compose, say a and b and write my own<br/>&gt;&gt; &gt; &#39;result&#39; which will combine a&#39;s result and b&#39;s result, what am I<br/>&gt;&gt; &gt; supposed to do?<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; I&#39;d always been under the impression that when I do:<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; with qw(a b);\<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; I&#39;m expressing the expectation that there are no conflicts between<br/>&gt;&gt; &gt; those two roles and I want an (ideally compile time) error if they do<br/>&gt;&gt; &gt; conflict, and I can get in and fix it through judicious use of<br/>&gt;&gt; &gt; excludes (and possibly an alias or two).<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; If I want the order of composition to matter, then I can do<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; with &#39;a&#39;;<br/>&gt;&gt; &gt; with &#39;b&#39;;<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; For the life of me I can&#39;t see how this change can be called a good idea.<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt;&gt; If what you&#39;re after here is a way to disallow all forms of silent<br/>&gt;&gt; &gt;&gt; method overriding, I think this is better done in an extension (since it<br/>&gt;&gt; &gt;&gt; would have to catch conflicts in inheritance situations as well anyway).<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; That&#39;s certainly not what I&#39;m after. But I do want to retain the<br/>&gt;&gt; &gt; difference between &#39;with qw(a b)&#39; and &#39;with q(a); with q(b);&#39; thank<br/>&gt;&gt; &gt; you very much.<br/>&gt;&gt; &gt;<br/>&gt;&gt; &gt; Who cooked up this idea?<br/>&gt;&gt;<br/>&gt;&gt; To clarify: I&#39;m all for having this:<br/>&gt;&gt;<br/>&gt;&gt; package a; use Moose::Role; sub result { &#39;a&#39; };<br/>&gt;&gt; package b; use Moose::Role; with &#39;a&#39;; sub result { &#39;b&#39; }<br/>&gt;&gt;<br/>&gt;&gt; work without throwing any warnings, but if that comes at the expense of:<br/>&gt;&gt;<br/>&gt;&gt; package a; use Moose::Role; sub result { &#39;a&#39; };<br/>&gt;&gt; package b; use Moose::Role; sub result { &#39;b&#39; };<br/>&gt;&gt; package c; use Moose; with qw(a b);<br/>&gt;<br/>&gt; No, this is still a conflict. Role composition and role summation are<br/>&gt; two separate processes.<br/><br/>Ah. Fair enough. Misunderstanding Ovid&#39;s original code sample.<br/> http://www.nntp.perl.org/group/perl.moose/2013/03/msg2602.html Thu, 28 Mar 2013 17:51:56 +0000