std.data.json formal review

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 17 14:41:03 PDT 2015


Am 17.08.2015 um 22:58 schrieb Suliman:
>> String is a valid range, but parseJSONValue takes a *reference* to a
>> range, because it directly consumes the range and leaves anything that
>> appears after the JSON value in the range. toJSON() on the other hand
>> assumes that the JSON value occupies the whole input range.
>
> Yeas, I understood, but maybe it's better to rename it (or add attention
> in docs, I seen your changes, but I think that you should extend it
> more, to prevent people doing mistake that I did) , because I think that
> it would be hard to understand it for people who come from other
> languages. I am writing in D for a long time, but still some things make
> me confuse...

I agree that the naming can be a bit confusing at first, but I chose 
those names to be consistent with std.conv (to!T and parse!T). I've also 
just noticed that the parser module example erroneously uses 
parseJSONValue(). With proper examples, this should hopefully not be 
that big of a deal.


More information about the Digitalmars-d mailing list