RFC: std.json sucessor

Andrej Mitrovic via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 22 12:15:20 PDT 2014


On 8/22/14, Sönke Ludwig <digitalmars-d at puremagic.com> wrote:
> Docs: http://s-ludwig.github.io/std_data_json/

This confused me for a solid minute:

// Lex a JSON string into a lazy range of tokens
auto tokens = lexJSON(`{"name": "Peter", "age": 42}`);

with (JSONToken.Kind) {
    assert(tokens.map!(t => t.kind).equal(
        [objectStart, string, colon, string, comma,
        string, colon, number, objectEnd]));
}

Generally I'd avoid using de-facto reserved names as enum member names
(e.g. string).



More information about the Digitalmars-d mailing list