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

Re: Proposal: initial type annotation in SV

Thread Previous
From:
Sébastien Aperghis-Tramoni
Date:
May 6, 2013 07:33
Subject:
Re: Proposal: initial type annotation in SV
Message ID:
3AA3F50F-8E36-4088-9BFD-C9054EDC48B5@free.fr
demerphq wrote:

> On 6 May 2013 09:20, Sébastien Aperghis-Tramoni <maddingue@free.fr> 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 B.pm 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About