develooper Front page | perl.perl5.porters | Postings from May 2013

Re: Proposal: initial type annotation in SV

Thread Previous | Thread Next
From:
Sébastien Aperghis-Tramoni
Date:
May 6, 2013 07:28
Subject:
Re: Proposal: initial type annotation in SV
Message ID:
3F5BB87E-D62E-4181-BE49-92F4C7155B4E@free.fr
H.Merijn Brand wrote:

> On Sun, 5 May 2013 23:45:25 +0200, Sébastien Aperghis-Tramoni
> <maddingue@free.fr> wrote:
> 
>> Because of this, some serializers resort to sniffing the value with
>> regexps (for example, XML::RPC, XMLRPC::Lite), which resolves part
>> of the problem, but introduces some side effects.
> 
> Of course the problem also exists the other way round
> 
> foo,mars,01042013,"This is wrong"
> 
> CSV data is likely to be "interpreted" as as Jan 4, 2013 in Excel,
> even when put inside quotes
> 
> foo,mars,"01042013","This is wrong"
> 
> Dates, with or without quotation, will always be a problem with Excel,
> as locales influence interpretation on both sides, generation and
> interpretation.
> 
> IMHO deserializers should NEVER interpret. They should do what is told
> them to do and not more. This implies that passing an option to parse
> (ISO) dates as YYYYMMDD, DDMMYYYY, MMYYYDD, or whatever should be fine

Agreed, but in that direction, it's usually a question specific to each deserializer.
The formats I was discussing (JSON, XML-RPC, Sereal) have well-defined types. "Be liberal in what you accept, be strict with what you emit". But Perl currently makes it difficult to be strict with what we emit, and the other end may not be liberal.


-- 
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.


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