diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2016-09-29 15:56:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-29 15:56:22 +0100 |
commit | 5e4708ef3b64079c9d65187a3ebdc33b7519fe27 (patch) | |
tree | d0035e1098af75c23bb933e036f37fc10d2e69fd /lib/pure | |
parent | 12eb5540f37eeeb75f1934c8efd86ad8af6d2c40 (diff) | |
download | Nim-5e4708ef3b64079c9d65187a3ebdc33b7519fe27.tar.gz |
Add few JSON examples
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/json.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 7ad7efd23..0b7908c02 100644 --- a/lib/pure/json.nim +++ b/lib/pure/json.nim @@ -24,6 +24,8 @@ ## jobj["test"] = newJFloat(0.7) # create or update ## echo($jobj["test"].fnum) ## echo($jobj["key2"].bval) +## echo jobj{"missing key"}.getFNum(0.1) # read a float value using a default +## jobj{"a", "b", "c"} = newJFloat(3.3) # created nested keys ## ## Results in: ## |