You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How should attributes be implemented? They're attached to classes (that's an entirely new concept to perl), as well as fields and methods (which would be analogous to existing lexical variables and subroutines).
The existing implementation of core perl's attributes is hugely inadequate for what we're doing here, and suggests we need something much better. It also suggests a way that attributes can be extended and implemented in better ways in existing locations too, so these ideas aren't unique to the new classy locations.
In particular, we need much finer-grained ability to inject code into more occasions during compile and runtime. The way Object::Pad does it is that every kind of attribute has a vtable of function pointers associated with it, that are invoked at different times. It feels a bit like the MAGIC vtable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How should attributes be implemented? They're attached to classes (that's an entirely new concept to perl), as well as fields and methods (which would be analogous to existing lexical variables and subroutines).
The existing implementation of core perl's attributes is hugely inadequate for what we're doing here, and suggests we need something much better. It also suggests a way that attributes can be extended and implemented in better ways in existing locations too, so these ideas aren't unique to the new classy locations.
In particular, we need much finer-grained ability to inject code into more occasions during compile and runtime. The way Object::Pad does it is that every kind of attribute has a vtable of function pointers associated with it, that are invoked at different times. It feels a bit like the MAGIC vtable.
Beta Was this translation helpful? Give feedback.
All reactions