develooper Front page | perl.perl5.porters | Postings from July 2017

Re: Behavior of bitwise ops on unencountered wide characters

Thread Previous | Thread Next
July 13, 2017 13:02
Re: Behavior of bitwise ops on unencountered wide characters
Message ID:

> But we don't have the luxury of ignoring the number/string distinction
> in JSON.  Some way of controlling the types is required.  The
> mechanism I've come up with covers most cases of unintentional type
> changes, allows for intentional type changes, and will round trip
> properly.

True enough, but the very vague string/integer distinction of core types 
  is a really poor choice of interface to achieve proper serialization, 
and there are other solutions you could devise.  For instance, you could 
define JSON::string and JSON::num classes that overload the usual 
operators and that map to and from the corresponding JSON types.

At some point you folks should accept that Perl core types don't and 
won't ever map naturally to JSON types.


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