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