tangled
alpha
login
or
join now
jon.recoil.org
/
ocaml-json-pointer
forked from
anil.recoil.org/ocaml-json-pointer
0
fork
atom
RFC6901 JSON Pointer implementation in OCaml using jsont
0
fork
atom
overview
issues
pulls
pipelines
fix
anil.recoil.org
2 months ago
01ab6a99
293a9451
+6
-6
1 changed file
expand all
collapse all
unified
split
doc
tutorial.mld
+6
-6
doc/tutorial.mld
···
466
466
467
467
This is where the [-] marker and append pointers shine - they append to the end:
468
468
469
469
-
{@ocaml[
469
469
+
{x@ocaml[
470
470
# (match of_string "/foo/-" with `Append p -> add p arr_obj ~value:(Jsont.Json.string "c") | `Nav _ -> assert false);;
471
471
-
- : Jsont.json = {"foo":["a","b","c"]}]}]}
472
472
-
]}
471
471
+
- : Jsont.json = {"foo":["a","b","c"]}
472
472
+
]x}
473
473
474
474
Or more conveniently using {!at_end}:
475
475
476
476
-
{@ocaml[
476
476
+
{x@ocaml[
477
477
# add (at_end (of_string_nav "/foo")) arr_obj ~value:(Jsont.Json.string "c")
478
478
;;
479
479
-
- : Jsont.json = {"foo":["a","b","c"]}]}]}
480
480
-
]}
479
479
+
- : Jsont.json = {"foo":["a","b","c"]}
480
480
+
]x}
481
481
482
482
{2 Remove}
483
483