you are viewing a single comment's thread
view the rest of the comments
[–] 3 points 9 months ago (3 children)

Eh, dkjson implements null as an object with a metatable function that encodes it back as "null". Hopefully it's considered equal to itself in comparisons.

Dkjson is fast enough for most scripting purposes. OTOH cjson's userdata null is supported by some other libraries that deal with data structures.

Of course, there's a problem then that various libs may have their own nulls, not equal to each other. There's even a lib that tries to marry some of them.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 1 point 9 months ago (2 children)

    interesting! it should be equal since it's always just a pointer to that same table.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 9 months ago (1 child)

    I just never tried, so amn't entirely sure.

    Iirc I needed a json lib on Windows, or was just fed up with compiling things for some reason, and used dkjson instead of cjson. It turned out to be more than adequate, as is pretty typical for Lua-only code. Although it can use the LPeg lib to speed up parsing.

  • source
  • parent
  • hideshow 1 child comment