Re: Roles on the CPAN
package that; use Moose; with 'fries'; # do we want this?
Re: Roles on the CPAN
* Ovid publiustemp-moduleautho...@yahoo.com [2010-07-26 21:35]: I'm thinking about writing a module which is merely a role (Moose::Role) which one must consume. While there doesn't appear to be a standard for this, I was thinking about trying to set a precedent and use the Does:: namespace. For example, if you want a upload a role which serializes things to YAML, you might call it Does::Serialize::YAML to make it clear it's a role to be consumed and not a stand-alone package. Verbs as namespaces usually read weird, and the objection regarding `with` is especially salient. I second TraitFor, or else just appending Role. Regards, -- Aristotle Pagaltzis // http://plasmasturm.org/
Re: Roles on the CPAN
On Monday 26 Jul 2010 22:31:24 Ovid wrote: I'm thinking about writing a module which is merely a role (Moose::Role) which one must consume. While there doesn't appear to be a standard for this, I was thinking about trying to set a precedent and use the Does:: namespace. For example, if you want a upload a role which serializes things to YAML, you might call it Does::Serialize::YAML to make it clear it's a role to be consumed and not a stand-alone package. Thoughts? Due to the fact Moose roles are used with the word 'with', it feels a little bit weird to say something like: package Car; use Moose; with 'Does::AutoPilot'; Although there is no reason not to make a keyword 'which' for that matter.
Roles on the CPAN
I'm thinking about writing a module which is merely a role (Moose::Role) which one must consume. While there doesn't appear to be a standard for this, I was thinking about trying to set a precedent and use the Does:: namespace. For example, if you want a upload a role which serializes things to YAML, you might call it Does::Serialize::YAML to make it clear it's a role to be consumed and not a stand-alone package. Thoughts? Cheers, Ovid -- Buy the book - http://www.oreilly.com/catalog/perlhks/ Tech blog- http://blogs.perl.org/users/ovid/ Twitter - http://twitter.com/OvidPerl Official Perl 6 Wiki - http://www.perlfoundation.org/perl6
Re: Roles on the CPAN
On Mon, Jul 26, 2010 at 3:31 PM, Ovid publiustemp-moduleautho...@yahoo.com wrote: I'm thinking about writing a module which is merely a role (Moose::Role) which one must consume. While there doesn't appear to be a standard for this, I was thinking about trying to set a precedent and use the Does:: namespace. For example, if you want a upload a role which serializes things to YAML, you might call it Does::Serialize::YAML to make it clear it's a role to be consumed and not a stand-alone package. I've seen TraitFor's all by themselves. -- Caleb Cushing http://xenoterracide.blogspot.com
Re: Roles on the CPAN
Ovid wrote: I'm thinking about writing a module which is merely a role (Moose::Role) which one must consume. While there doesn't appear to be a standard for this, I was thinking about trying to set a precedent and use the Does:: namespace. For example, if you want a upload a role which serializes things to YAML, you might call it Does::Serialize::YAML to make it clear it's a role to be consumed and not a stand-alone package. Thoughts? Seems reasonable. If it's Moose-specific, then maybe see if you can work that into the name too. -- David Cantrell | Hero of the Information Age Do not be afraid of cooking, as your ingredients will know and misbehave -- Fergus Henderson