Skip Menu |

This queue is for tickets about the Moose CPAN distribution.

Report information
The Basics
Id: 60739
Status: resolved
Priority: 0/
Queue: Moose

People
Owner: Nobody in particular
Requestors: perl [...] evancarroll.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Moose Attribute Traits are still globally registered strings.
I was just reviewing the UI to add a costumed labeled attribute trait: http://search.cpan.org/~drolsky/Moose- 1.10/lib/Moose/Cookbook/Meta/Recipe3.pod It seems to me like this is eerily the same bad design decision that led to global string-types rather than MooseX::Types. Why not instead use the same system for exporting subs that describe the Attribute Trait than string names? package Moose::Meta::Attribute::Custom::Trait::Labeled; sub register_implementation {'MyApp::Meta::Attribute::Trait::Labeled'} That just looks ugly. Looking back at it... - Mention MooseX::Types early to avoid users falling down the string parsing rathole (mst) -- Evan Carroll System Lord of the Internets http://www.evancarroll.com
**custom attribute trait Sorry, rt won't let me edit though. At least it is the Best.. or Practical, or something. -- Evan Carroll System Lord of the Internets http://www.evancarroll.com
This is the first I've heard of this idea. Go for it! It should be do-able as a MooseX module just like MooseX-Types was. As the Contributing documentation says, we're very open to refactoring the Moose internals to make extensions easier, though it's unlikely that we'll accept this as a core feature from the get-go.
The 'trait_aliases' option was added to Moose::Exporter in 1.15, which provides this functionality.