From 36be28aa47b6387f6daac6bbe6589eb8cd1ae019 Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Thu, 5 May 2016 22:02:48 +0100 Subject: [PATCH] Add another JSON example JSON generation can be a bit tricky, another example might help --- lib/pure/json.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index b9da8a0dd0..5a819b7d8c 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -49,6 +49,10 @@ ## "age": herAge ## } ## ] +## +## var j2 = %* {"name": "Isaac", "books": ["Robot Dreams"]} +## j2["details"] = %* {"age":35, "pi":3.1415} +## echo j2 import hashes, tables, strutils, lexbase, streams, unicode, macros