Re: AttributeHelpers -> Trait::Native
Awesome work guys, but I hate the name, ... Native?!?! wtf? ;) On Jul 10, 2009, at 6:28 PM, Hans Dieter Pearcey wrote: doy++ did a bunch of cleanup in the attribute_helpers branch, and I followed after. So far: Moose::AttributeHelpers::Trait::X became Moose::Meta::Attribute::Trait::Native::X. Bag is gone. Moose::AttributeHelpers became Moose::Attribute::Native -- all this module does is install the register_implementation subs for trait shortnames (Bool, etc.); it doesn't actually load the traits. This is because: Moose.pm uses Moose::Attribute::Native, meaning that all the Native trait shortnames are available by default. Tests got renamed and minorly cleaned up. Remaining to do: Documentation needs to be consolidated in the Trait::Native::X modules, and the MethodProviders need to be explicitly undocumented. Moose::Attribute::Native's documentation needs editing. We decided today on IRC that it made the most sense as a general overview page for the Native traits, i.e. something we can point to from Manual::Attributes and Manual::Delegation. Put off for future consideration: Native traits could be automatically applied to attributes based on their type constraints, rather than applying traits that supply a default type constraint. e.g. (isa => Str) could apply the String trait, rather than (traits => ['String']) implying the Str TC. We decided that this isn't worth waiting to core Native traits for, and that we can always add it later, since the primary feature of Native traits is to enable 'handles' for native data types, and no one's going to have already been using 'handles' with a HashRef or Str. Questions: Should we stuff more documentation into Moose::Attribute::Native, and leave the Trait::Native::X modules as stubs that point to it? Since many of these modules are almost entirely "X: works like the builtin function X", it seems silly to make people have to look at a bunch of different manpages. Thoughts? (At that point it may also make more sense to rename it to something like Moose::Manual::Attributes::Native.) hdp.
AttributeHelpers -> Trait::Native
doy++ did a bunch of cleanup in the attribute_helpers branch, and I followed after. So far: Moose::AttributeHelpers::Trait::X became Moose::Meta::Attribute::Trait::Native::X. Bag is gone. Moose::AttributeHelpers became Moose::Attribute::Native -- all this module does is install the register_implementation subs for trait shortnames (Bool, etc.); it doesn't actually load the traits. This is because: Moose.pm uses Moose::Attribute::Native, meaning that all the Native trait shortnames are available by default. Tests got renamed and minorly cleaned up. Remaining to do: Documentation needs to be consolidated in the Trait::Native::X modules, and the MethodProviders need to be explicitly undocumented. Moose::Attribute::Native's documentation needs editing. We decided today on IRC that it made the most sense as a general overview page for the Native traits, i.e. something we can point to from Manual::Attributes and Manual::Delegation. Put off for future consideration: Native traits could be automatically applied to attributes based on their type constraints, rather than applying traits that supply a default type constraint. e.g. (isa => Str) could apply the String trait, rather than (traits => ['String']) implying the Str TC. We decided that this isn't worth waiting to core Native traits for, and that we can always add it later, since the primary feature of Native traits is to enable 'handles' for native data types, and no one's going to have already been using 'handles' with a HashRef or Str. Questions: Should we stuff more documentation into Moose::Attribute::Native, and leave the Trait::Native::X modules as stubs that point to it? Since many of these modules are almost entirely "X: works like the builtin function X", it seems silly to make people have to look at a bunch of different manpages. Thoughts? (At that point it may also make more sense to rename it to something like Moose::Manual::Attributes::Native.) hdp.
Re: Broken Moose Install
fREW Schmidt wrote: Hey guys, I updated everything that I could in CPAN and somehow it destroyed my moose install. This is what happens when I try to run my Cat app: Use of uninitialized value in goto at /usr/local/share/perl/5.10.0/Moose/Meta/Attribute.pm line 74. Could not create the 'reader' method for type_constraint because : goto must have label at /usr/local/share/perl/5.10.0/Moose/Meta/Attribute.pm line 74. at /usr/local/lib/perl/5.10.0/Class/MOP/Attribute.pm line 390 I think that your Moose and Class::MOP versions are inconsistent. I've seen this when you have very new Class::MOP, but old Moose. Can you try upgrading both to latest and see if that fixes it? Cheers t0m