From 80744fe4f7c2194b8fdc39c5390108ef5b20de6e Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Sat, 19 Nov 2016 16:55:47 +0000 Subject: [PATCH] Add [un]marshalling examples --- lib/pure/marshal.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pure/marshal.nim b/lib/pure/marshal.nim index 36e6cf52fe..5eb8f7c1c4 100644 --- a/lib/pure/marshal.nim +++ b/lib/pure/marshal.nim @@ -29,6 +29,12 @@ ## a = b ## echo($$a[]) # produces "{}", not "{f: 0}" ## +## # unmarshal +## let c = to[B]("""{"f": 2}""") +## +## # marshal +## let s = $$c + ## **Note**: The ``to`` and ``$$`` operations are available at compile-time! import streams, typeinfo, json, intsets, tables, unicode