Bug with Moose::Role attributes

2009-07-15 Thread Ovid
Hi all, On the Perl 6 language list, Raphael Descamps posted a link to a paper explaining how to implement stateful traits (http://scg.unibe.ch/archive/papers/Berg07eStatefulTraits.pdf). One of the authors of that paper worked on the original traits paper and the research appears solid.

Re: Bug with Moose::Role attributes

2009-07-15 Thread Jesse Luehrs
On Wed, Jul 15, 2009 at 11:24:11AM -0700, Ovid wrote: Consider the following code. Now that the role provides an attribute named counter and the class using the role provides a method of the same name. The methods are not semantically equivalent, so I had two expectations, possibly due to

Re: Bug with Moose::Role attributes

2009-07-15 Thread Stevan Little
). Same as #2, I agree with you, but until we have first class role attributes and can calculate the methods they will create at composition time, we won't be able to fix this. I expect that people will have different views, but that's OK. Have fun with that. Well not me, except

Role attributes

2009-05-27 Thread Dmitri Ostapenko
Is there a way to tell which attributes come from role? I can't think of a good way of doing this besides from changing attributes names in some way. Using prefix for example.. tx,

Re: Role attributes

2009-05-27 Thread Chris Prather
On Wed, May 27, 2009 at 4:24 PM, Dmitri Ostapenko dmi...@farematrix.com wrote: Is there a way to tell which attributes come from role? I can't think of a good way of doing this besides from changing attributes names in some way. Using prefix for example.. tx, What are you trying to

Re: Role attributes

2009-05-27 Thread Dimitri Ostapenko
Chris Prather wrote: On Wed, May 27, 2009 at 4:24 PM, Dmitri Ostapenko dmi...@farematrix.com wrote: Is there a way to tell which attributes come from role? I can't think of a good way of doing this besides from changing attributes names in some way. Using prefix for example.. tx,

Re: Role attributes

2009-05-27 Thread Hans Dieter Pearcey
On Wed, May 27, 2009 at 04:40:37PM -0400, Dimitri Ostapenko wrote: So using a role to model lower-level table I need to be able to tell which attributes come from class and which come from role in methods for saving and retrieving data. Maybe you want a trait for your attributes that

Re: Role attributes

2009-05-27 Thread Dimitri Ostapenko
Hans Dieter Pearcey wrote: On Wed, May 27, 2009 at 04:40:37PM -0400, Dimitri Ostapenko wrote: So using a role to model lower-level table I need to be able to tell which attributes come from class and which come from role in methods for saving and retrieving data. Maybe you want

Re: Role attributes

2009-05-27 Thread Hans Dieter Pearcey
On Wed, May 27, 2009 at 05:16:28PM -0400, Dimitri Ostapenko wrote: # Need to know here which attr comes from where to be able to save into correct table Yes, I understand the problem. That's why I suggested a role for your attribute class so that you can say e.g. has foo = (is = 'ro',

Re: Role attributes

2009-05-27 Thread Stevan Little
On May 27, 2009, at 4:40 PM, Dimitri Ostapenko wrote: Chris Prather wrote: On Wed, May 27, 2009 at 4:24 PM, Dmitri Ostapenko dmi...@farematrix.com wrote: Is there a way to tell which attributes come from role? I can't think of a good way of doing this besides from changing attributes names