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

Re: Behavior of bitwise ops on unencountered wide characters

Thread Previous | Thread Next
From:
perl
Date:
July 13, 2017 13:02
Subject:
Re: Behavior of bitwise ops on unencountered wide characters
Message ID:
24c5af6f-c59d-7565-680d-5ca368c745ab@profvince.com

> 
> 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.


Vincent

Thread Previous | Thread Next


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