Add [un]marshalling examples

This commit is contained in:
Federico Ceratto 2016-11-19 16:55:47 +00:00 • committed by GitHub
commit 80744fe4f7

View file

@ -29,6 +29,12 @@
## a = b ## a = b
## echo($$a[]) # produces "{}", not "{f: 0}" ## 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! ## **Note**: The ``to`` and ``$$`` operations are available at compile-time!
import streams, typeinfo, json, intsets, tables, unicode import streams, typeinfo, json, intsets, tables, unicode