develooper Front page | perl.perl5.porters | Postings from December 2021

Re: Pre-RFC: `unknown` versus `undef`

Thread Previous | Thread Next
From:
Darren Duncan
Date:
December 19, 2021 01:30
Subject:
Re: Pre-RFC: `unknown` versus `undef`
Message ID:
a598e648-8228-63df-0932-1a8ff79dfd19@darrenduncan.net
Another implication we also have to think about how this would affect 
interchange with other languages or serialization formats.

In particular, JSON has "null".

Before this proposal, it seemed fairly clear cut that a Perl "undef" would map 
to JSON "null" bi-directionally and losslessly.

So if we also have "unknown", then what would a JSON "null" map to on importing 
from JSON, and would both "undef" and "unknown" map to null on exporting to JSON?

I would suggest that both "unknown" and "undef" map to null when exporting to 
JSON, and that when importing from JSON there is a configuration option to the 
importer that says whether to use "unknown" or "undef".

-- Darren Duncan


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