Better HN
topnewbestaskshowjobs
Log inSign up

timotheecour

4 karma · joined Mar 20, 2018 (8y ago) · 2 submissions

Submissions

comment 5y ago · link · parent

yes, invalid JSON would raise an exception.

comment 5y ago · link · parent

Checkout the newer std/jsonutils: https://nim-lang.github.io/Nim/jsonutils.html

let a = (1.5'f32, (b: "b2", a: "a2"), 'x', @[Foo(t: true, z1: -3), nil])

let j = a.toJson

assert j.jsonTo(typeof(a)).toJson == j