Luke Palmer wrote:

Going about (finally) implementing my Infinity pmc, I noticed a lot of
redundant code in the Perl* classes.
[ ... ]
The way I see this being done is by adding another level of
indirection.  PerlScalar would implement its polymorphic behavior in
the set_* methods, and delegate everything else to its "contained"
pmc.  Things like TiedScalar would do the same, but it would delegate
to methods on its contained object, &c.

This is, what the intended var/value split of the vtable is for. I don't like code duplication too, but OTOH its faster then going one more indirection or better calling another vtable method.



Of course, there is a slight added cost for the extra level of
indirection, but it's worth it IMO.  Is this worth persuing?

Don't know yet. When we have more experience with $HL needs and var/value split, references or TiedScalar are in, we can look again and more detailed at it.



Luke

leo






Reply via email to