Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Larry Wall
On Thu, Mar 12, 2009 at 04:03:15PM -0300, Daniel Ruoso wrote: : Em Qui, 2009-03-12 às 11:49 -0700, Larry Wall escreveu: : > In addition to what Jonathan said, it is possible that the ability : > to coerce multiple arguments depends on the type itself, since we : > probably want to allow Foo(1,2,3)

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Larry Wall
On Thu, Mar 12, 2009 at 01:38:30PM -0700, Dave Whipp wrote: > Larry Wall wrote: >> Note however that coercions require parens these days, since types parse >> as values, not as routine names. >> >> $x = Role::Serializable::XML($resultset); >> $y = Role::Serializable::YAML($resultset); > > S

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Dave Whipp
Larry Wall wrote: Note however that coercions require parens these days, since types parse as values, not as routine names. $x = Role::Serializable::XML($resultset); $y = Role::Serializable::YAML($resultset); Should "indirect object" syntax work in this context?: $a = Foo: $value;

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Daniel Ruoso
Em Qui, 2009-03-12 às 11:49 -0700, Larry Wall escreveu: > In addition to what Jonathan said, it is possible that the ability > to coerce multiple arguments depends on the type itself, since we > probably want to allow Foo(1,2,3) and such for listy types that > don't necessarily want to use the [1,2

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Larry Wall
On Thu, Mar 12, 2009 at 03:29:09PM -0300, Daniel Ruoso wrote: : Em Qui, 2009-03-12 às 19:07 +0100, Jonathan Worthington escreveu: : > IIRC, that's a special syntactic form that only counts when it is on the : > RHS of but or does. (And yes, in this case it fails if the role has more : > than one

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Larry Wall
On Thu, Mar 12, 2009 at 03:05:17PM -0300, Daniel Ruoso wrote: : Em Qui, 2009-03-12 às 10:28 -0700, Larry Wall escreveu: : > On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote: : > : > From: David Green : > : > I suppose, but is there a reason why you want to apply roles instead of coercing : >

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Daniel Ruoso
Em Qui, 2009-03-12 às 19:07 +0100, Jonathan Worthington escreveu: > IIRC, that's a special syntactic form that only counts when it is on the > RHS of but or does. (And yes, in this case it fails if the role has more > than one attr...) I think in all other cases, it's a coercion. hmm... for som

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Jonathan Worthington
Daniel Ruoso wrote: Em Qui, 2009-03-12 às 10:28 -0700, Larry Wall escreveu: On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote: : > From: David Green : > I suppose, but is there a reason why you want to apply roles instead of coercing : > the results? : Because I am coming from Moose inst

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Daniel Ruoso
Em Qui, 2009-03-12 às 10:28 -0700, Larry Wall escreveu: > On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote: > : > From: David Green > : > I suppose, but is there a reason why you want to apply roles instead of > coercing > : > the results? > : Because I am coming from Moose instead of Perl 6

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Larry Wall
On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote: : : - Original Message : : > From: David Green : : > I suppose, but is there a reason why you want to apply roles instead of coercing : > the results? : > : > $x = Role::Serializable::XML $resultset; : > $y = Role::Serial

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-12 Thread Ovid
- Original Message > From: David Green > I suppose, but is there a reason why you want to apply roles instead of > coercing > the results? > > $x = Role::Serializable::XML $resultset; > $y = Role::Serializable::YAML $resultset; Because I am coming from Moose instead of Per

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-10 Thread David Green
On 2009-Mar-9, at 3:32 am, Ovid wrote: Since you cache resultsets if they've not changed, you could easily have the XML and YAML roles getting reapplied at runtime multiple times. Could this issue be mitigated with temp variables? { temp $resultset does Role::Serializable::YAML; pr

Re: Recursive Runtime Role Reapplication Really Rebounds

2009-03-09 Thread Ovid
- Original Message > From: Ovid > Eventually, the code broke and threw a bunch of weird "recursive inheritance" > warnings due to multiple anonymous classes being applied to the object. This > was *real fun* to debug, but I can imagine a scenario for this being natural: > > Your RE

Recursive Runtime Role Reapplication Really Rebounds

2009-03-08 Thread Ovid
(OK, the subject sucked, but I tried :) From S14: You can, however, say $fido does Sentry; $fido does Tricks; $fido does TailChasing; $fido does Scratch; Unlike the compile-time role composition, each of these layers on a new mixin with a new level of inheritance