summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-19 16:55:47 +0000
committerGitHub <noreply@github.com>2016-11-19 16:55:47 +0000
commit80744fe4f7c2194b8fdc39c5390108ef5b20de6e (patch)
treee0f55a4eae0cd0a57725ee64429c6effce5e00e0 /lib/pure
parent9ca3ae14ab5d4bff1c5016a2919414c720bb82f8 (diff)
downloadNim-80744fe4f7c2194b8fdc39c5390108ef5b20de6e.tar.gz
Add [un]marshalling examples
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/marshal.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pure/marshal.nim b/lib/pure/marshal.nim
index 36e6cf52f..5eb8f7c1c 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