develooper Front page | perl.perl5.porters | Postings from May 2013

Re: Proposal: initial type annotation in SV

Thread Previous
Sébastien Aperghis-Tramoni
May 6, 2013 07:33
Re: Proposal: initial type annotation in SV
Message ID:
demerphq wrote:

> On 6 May 2013 09:20, Sébastien Aperghis-Tramoni <> wrote:
>> In my previous $jobs, I didn't use serialized data that much. But in my current job, there's a lot of serialized data, both JSON and XML-RPC. I've subclassed the serializers so they use to detect whether the SV is a IV, NV or PV, which is semantically more correct but still leave some corner cases uncovered.
> Some of the corner cases? You mean *all* of the corner cases.  Doing
> plain IV/UV/NV/PV is easy, as they are all "single form" types. Its
> when they get upgraded to a higher svtype due to stringification or
> numification they lose information required to properly serialize the
> data.

I was trying to be diplomatic :)

But yes, I used a couple of heuristics, assuming that if a SV is NOK, it's very probably a float, if it's IOK, it's an integer. It works in our use cases, but I know it's not generic enough.

Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.

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