[Xml-compile] $_[0] + 0.0 for sloppy floats

Chase Whitener cwhitener at gmail.com
Tue Dec 16 16:07:46 GMT 2014


I think Mojo::JSON handled the booleans about as well as can be expected
with Perl.

examples:

perl -Mojo -E 'my $true_scalar = "1"; my $false_scalar = "0"; say j([1,
"1", \1, Mojo::JSON->true, \$true_scalar, 0, "0", \0, Mojo::JSON->false,
\$false_scalar])'

perl -Mojo -E 'say j([1, \1, Mojo::JSON->true])'

IRC conversation about it:
http://irclog.perlgeek.de/mojo/2014-11-27



On Tue, Dec 16, 2014 at 10:58 AM, Mark Overmeer <mark at overmeer.net> wrote:
>
> * Patrick Powell (papowell at astart.com) [141216 15:34]:
> > Ummm... and look at JSON and 'true' and 'false'.
>
> Correct.  In Apache::Solr, I ended up building tables of fields and which
> are boolean, to automatically translate Perl's concept of booleans into
> Solr's URI parameters.
>
> IMO Perl libraries should attempt to hide the typedness of interfaces...
> JSON itself is on a too basic level to do it itself.  But interfaces
> which transport their data via JSON could (should?) try to automate the
> required conversions... often quite some work.
> --
> Regards,
>
>                MarkOv
>
> ------------------------------------------------------------------------
>        Mark Overmeer MSc                                MARKOV Solutions
>        Mark at Overmeer.net                          solutions at overmeer.net
> http://Mark.Overmeer.net                   http://solutions.overmeer.net
>
>
> _______________________________________________
> Xml-compile mailing list
> Xml-compile at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20141216/00ac4140/attachment-0001.htm>


More information about the Xml-compile mailing list