std.data.json formal review

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 28 00:02:27 PDT 2015


Am Tue, 18 Aug 2015 09:05:32 +0000
schrieb "Marc Schütz" <schuetzm at gmx.net>:

> Or, as above, leave it to the end user and provide a `to(T)` 
> method that can support built-in types and `BigInt` alike.

You mean the user should write a JSON number parsing routine
on their own? Then which part is responsible for validation of
JSON contraints? If it is the to!(T) function, then it is
code duplication with chances of getting something wrong,
if it is the JSON parser, then the number is parsed twice.
Besides, there is a lot of code to be shared for every T.

-- 
Marco



More information about the Digitalmars-d mailing list