MooseX::NonMoose for Roles?

2011-01-28 Thread Zbigniew Lukasiak
Are there any sane options for building Moose::Roles out of Non Moose classes? Or maybe it is trivial? -- Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Hans Dieter Pearcey
On Fri, 28 Jan 2011 21:29:04 +0100, Zbigniew Lukasiak zzb...@gmail.com wrote: Are there any sane options for building Moose::Roles out of Non Moose classes? building roles out of classes is like building tires out of cars. Maybe you actually want a role that has an attribute that holds an

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Jesse Luehrs
On Fri, Jan 28, 2011 at 09:29:04PM +0100, Zbigniew Lukasiak wrote: Are there any sane options for building Moose::Roles out of Non Moose classes? Or maybe it is trivial? You can't just turn a class into a role - that doesn't really make sense. What you can do is use delegation instead:

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Karen Etheridge
On Fri, Jan 28, 2011 at 09:29:04PM +0100, Zbigniew Lukasiak wrote: Are there any sane options for building Moose::Roles out of Non Moose classes? Or maybe it is trivial? The thing about roles is they aren't instantiated, so you can't really do: package MyApp::Role::Foo; use base

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Karen Etheridge
On Fri, Jan 28, 2011 at 12:35:38PM -0800, Karen Etheridge wrote: However, if you imported functions from that class into your role, you can make them available in your role just the same as if you had implemented them into your role itself. ..However that only works for functions, not anything

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Zbigniew Lukasiak
On Fri, Jan 28, 2011 at 9:31 PM, Hans Dieter Pearcey h...@pobox.com wrote: On Fri, 28 Jan 2011 21:29:04 +0100, Zbigniew Lukasiak zzb...@gmail.com wrote: Are there any sane options for building Moose::Roles out of Non Moose classes? building roles out of classes is like building tires out

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Zbigniew Lukasiak
On Fri, Jan 28, 2011 at 10:25 PM, Chris Prather ch...@prather.org wrote: On Fri, Jan 28, 2011 at 4:13 PM, Stevan Little stevan.lit...@iinteractive.com wrote: On Jan 28, 2011, at 4:06 PM, Zbigniew Lukasiak wrote: On Fri, Jan 28, 2011 at 9:35 PM, Karen Etheridge p...@froods.org wrote: On Fri,

Re: MooseX::NonMoose for Roles?

2011-01-28 Thread Hans Dieter Pearcey
On Fri, 28 Jan 2011 22:36:30 +0100, Zbigniew Lukasiak zzb...@gmail.com wrote: I am testing here if it could be made easy to use a library with multiple inheritance in Moose. Assuming that the additional base classes already work in a way similar to Moose Roles. If you want your classes to be