On Thursday, 29 January 2015 at 13:16:48 UTC, BlackEdder wrote:
On Thursday, 29 January 2015 at 00:24:44 UTC, rlonstein wrote:

Not quite the same, but I've been using dson
(https://github.com/w0rp/dson).

Have you looked it over?


Did not know about that one. From looking through the source it seems to have a different goal though. dson looks like it is an alternative to std.json. Painlessjson is meant to make it easier to use json, by automatically (de)serializing objects/structs and converting them to (and from) json.

For example:
class Point
{
  double x;
  double y;
}

void main()
{
  auto pnt = new Point( 1,2 );
auto jsonPnt = toJSON( pnt ); // Returns a JSONValue( "{ "x": 1.0, "y": 2.0 }" )
  auto nPnt = fromJSON!Point( jsonPnt );
  assert( nPnt.x == pnt.x && nPnt.y == pnt.y );
}

I guess it would be interesting to use dson instead of std.json as a basis for Painlessjson.

I believe we should continue using std.json, and instead push for taking dson (or its lessons learned) into phobos if it's a better implementation. The best general solution should be the one that is available out of the box.
  • painlessjson released, looki... Pierre Krafft via Digitalmars-d-announce
    • Re: painlessjson releas... rlonstein via Digitalmars-d-announce
      • Re: painlessjson re... BlackEdder via Digitalmars-d-announce
        • Re: painlessjso... Pierre Krafft via Digitalmars-d-announce
          • Re: painles... Chris via Digitalmars-d-announce
            • Re: pa... BlackEdder via Digitalmars-d-announce
              • Re... Rory McGuire via Digitalmars-d-announce
              • Re... Pierre Krafft via Digitalmars-d-announce
                • ... Vladimir Panteleev via Digitalmars-d-announce
                • ... data man via Digitalmars-d-announce
                • ... Vladimir Panteleev via Digitalmars-d-announce
                • ... data man via Digitalmars-d-announce
                • ... Vladimir Panteleev via Digitalmars-d-announce
                • ... data man via Digitalmars-d-announce

Reply via email to