www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - std.json: why no constructors

reply "Ivan Kazmenko" <gassa mail.ru> writes:
Why doesn't JSONValue have constructors for the types it can 
store?  Like these: 
https://github.com/GassaFM/icfpc2013/blob/master/icfputil/icfplib.d#L76-L112

Or did I entirely miss the One Right Way to do that?

I know there is std.serialization on its way, but for now, it was 
just more convenient to use what is already present in Phobos.

Ivan Kazmenko.
Aug 15 2013
parent David <d dav1d.de> writes:
Am 15.08.2013 11:19, schrieb Ivan Kazmenko:
 Why doesn't JSONValue have constructors for the types it can store? 
 Like these:
 https://github.com/GassaFM/icfpc2013/blob/master/icfputil/icfplib.d#L76-L112
 
 
 Or did I entirely miss the One Right Way to do that?
 
 I know there is std.serialization on its way, but for now, it was just
 more convenient to use what is already present in Phobos.
 
 Ivan Kazmenko.
I have a pull request: https://github.com/D-Programming-Language/phobos/pull/1421 But I haven't even gotten once comment about it, probably the best way is to copy the file and include it in your project (as I do).
Aug 15 2013