P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Yes, traits should integrate into this well, at least conceptually. (I'll have to review Class::Trait more closely before commenting on any potential compatibility with that specific implementation.) Some introspections should be possible, but the property names aren't directly available at the moment -- only references are saved away. However, if accessors are created, those methods would define what is available to a trait. (Traits would be in a different lexical scope and would have to use accessors.) Getting the property names for accessors is actually a bit tricky and would involve either ugly syntax (property name => my %name) or else using something like PadWalker to find the name from the reference. I haven't worked out an elegant/portable approach yet. -xdg Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk. In reply to Re^2: Introducing Class::InsideOut
by xdg
|
|