> Can you detail more what this change is and why? > > Best I can tell from the other thread and the github commit views was > that it just adds a bunch of methods to Moose::Meta::Attribute that > delegate to the instance inliners. I am not sure what this buys you > beyond less code to write and hiding the instance protocol.
They are mainly useful for overwriting. My current code for MooseX::Attribute::Delegated at http://github.com/xabbu42/MooseX-Attribute-Delegated has to use a custom Method::Accessor and a custom Method::Constructor with two mostly copy-pasted methods (see http://github.com/xabbu42/MooseX-Attribute- Delegated/blob/master/lib/MooseX/Attribute/Delegated.pm) With this changes I could overwrite the inline_* methods in the Meta::Attribute::Role instead and avoid copy-pasting unrelated code. The proposed changes also give a higher chance for MX::Attribute::Delegated to be compatible with Extensions which change Method::Constructor and/or Method::Accessor (provided they use the inline_* methods of the Attribute), because they clearer separate the involved concerns: as I see it, Method::Constructor defines the behavior of a constructor and should not presuppose the way a specific attribute gets stored in the object. How an attribute gets stored should instead be decided by the attribute meta- object. Same story for Method::Accessor. I'll try to find an example on CPAN for this point. My changes streamline some inconsistencies in the current code too. The current code uses sometimes $attr->name and sometimes $attr->slots to decide on the slot name. Overwriting the slots method of Meta::Attribute therefore currently gives you a buggy attribute, since some code incorrectly still uses the name of the attribute as slot name. This bug can of course be fixed without my changes. The point is that bugs like this are easier avoided if all code concerning inline attribute storage is concentrated in one place. > > My concern is that the instance meta-object is actually associated > with the meta-class, not with the attribute meta-object so by pushing > this in here it will make things more confusing The Method::Accessor on the other hand is associated with the Attribute, and currently contains the same calls to the instance meta-object. Perhaps a remark in the documentation on why this methods exist would help? I'm unsure on how much extending Class::MOP and Moose should be explained in the documentation, since it just confuses people which want to use it as is. - xabbu42