std.data.json formal review

Sönke Ludwig via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 17 13:45:12 PDT 2015


Am 17.08.2015 um 22:23 schrieb Suliman:
> On Monday, 17 August 2015 at 20:07:24 UTC, Sönke Ludwig wrote:
>>
>> toJSONValue() is the right function in this case. I've update the
>> docs/examples to make that clearer.
>
> I think that I miss understanding conception of ranges. I reread docs
> but can't understand what I am missing. Ranges is way to access of
> sequences, but why I can't take input from string? string is not range?

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.


More information about the Digitalmars-d mailing list