> On Aug 21, 2023, at 6:30 AM, Martijn Lievaart via perl5-porters <perl5-porters@perl.org> wrote: > So basically you are implying #2 can work for classes (for Perl::Types), because classes use SVs in a certain predictable way. But for anything else, this will not work as exposing SVs will not do anything useful for the context we are looking at, correct? Classes are a red-herring here, and kinda orthogonal. Specifically the APIs that things like Lexical::Types exposes simply don’t exist (as far as I could tell) for anything but scalars. It feels like we implemented just enough to make fields.pm work as a proof of concept and then moved on with our lives. The reason that Perl::Types shouldn’t have any issue after this is that presumably once they know what type a variable is they can simply call SvIOK, SvNOK, or SvPOK … Looking at RPerl, each type has a class associated with it so I would assume that there is some mechanism XS to perform the assertion that doesn’t use something like Variable::Magic. I mean if you can solve the annotation problem, worst case scenario is that you implement a system like https://metacpan.org/pod/Object::Pad::FieldAttr::Checked to do the assertion on set and use the various Sv*OKs. -ChrisThread Previous | Thread Next