On Monday 09 November 2009 23:54:07 Stevan Little wrote: > On Nov 9, 2009, at 5:42 PM, Jesse Luehrs wrote: > > On Mon, Nov 09, 2009 at 05:26:17PM -0500, Stevan Little wrote: > >> 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. > >> > >> 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 reasoning I had for thinking it was reasonable is that the > > meta-attribute already has get_value, set_value, etc, so I don't see > > why > > it shouldn't also control the inline versions of those. It would > > probably make things simpler for attributes that wanted to use a > > different slot configuration than we have by default. > > Okay, that does make some sense, but I am concerned that people will > attempt to override them at that point (in a subclass of Attribute) > instead of in the instance metaclass where it belongs. If we can > prevent that from happening I would feel better.
I tried to document better when to override the inline_* methods in the attribute meta class, and when to create a new instance meta class. This is quite difficult for me though because of the foreign language. You can see the changes I made at http://github.com/xabbu42/class- mop/commit/4e83c39b1c55fe98562719e3580da0ce9f244e42 I copied some bits of doy's reply in this thread, as his description matches most closely how I interpreted the intention of the existing code. An example overriding the attribute inline_* methods would probably be helpful. This would at the same time extend the tests. I'll try to write something, but no promises... - xabbu42 P.S The second paragraph in the documentation of Class::MOP::Instance talking about encapsulation and using wrappers in Class::MOP::Class and Class::MOP::Attribute imho applies to inline_get_slot_value just as well as to get_slot_value. P.P.S Is there not the same potential for confusion with the get_raw_value and company methods of the attribute meta class? > > - Stevan >