develooper Front page | perl.perl5.porters | Postings from August 2023

Re: PPC Elevator Pitch for Perl::Types

Thread Previous | Thread Next
Chris Prather
August 21, 2023 11:18
Re: PPC Elevator Pitch for Perl::Types
Message ID:

> On Aug 21, 2023, at 6:30 AM, Martijn Lievaart via perl5-porters <> 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 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 to do the assertion on set and use the various Sv*OKs.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About