Page
Library
Module
Module type
Parameter
Class
Class type
Source
Json_spelJson with embedded expressions utilities.
val null : Json_spel_t.json_spelThe null value of JSON.
val int : int -> Json_spel_t.json_spelint n build the value of JSON n.
val bool : bool -> Json_spel_t.json_spelbool b build the value of JSON b.
val string : string -> Json_spel_t.json_spelstring s build the value of JSON s.
val assoc : (string * Json_spel_t.json_spel) list -> Json_spel_t.json_spelassoc o build the JSON object o.
val list : Json_spel_t.json_spel list -> Json_spel_t.json_spellist l build the JSON list l.
json/json_spel conversionval to_json : Json_spel_t.json_spel -> Wcs_t.jsonto_json v convert v value into json. Expressions are turned into strings with using the Spel concrete syntax.
val of_json : Wcs_t.json -> Json_spel_t.json_spelof_json j convert j into json_spel. Strings literals in j are parsed as text containing quoted spel expressions.
val set :
Json_spel_t.json_spel ->
string ->
Json_spel_t.json_spel ->
Json_spel_t.json_spelset o x v add (or replace) the a field x of the object o with value v.
val get : Json_spel_t.json_spel -> string -> Json_spel_t.json_spel optionget o x gets the value of the field x of the object o.
val take :
Json_spel_t.json_spel ->
string ->
Json_spel_t.json_spel * Json_spel_t.json_spel optiontake o x gets the value of the field x of the object o and remove the field from the object. The left part of the return value is the modified object and the right part is the value of the field.
val assign : Json_spel_t.json_spel list -> Json_spel_t.json_spelassign [o1; ...; on] create a json object that contains all the fields of the objets o1, ..., on. It is similare the the JavaScript function Object.assing({}, o1, ... on).
val push :
Json_spel_t.json_spel ->
string ->
Json_spel_t.json_spel ->
Json_spel_t.json_spelpush o x v add the value v in the list stored in a field x of the object o. It the field x doesn't exists, it creates it.
val pop :
Json_spel_t.json_spel ->
string ->
Json_spel_t.json_spel * Json_spel_t.json_spel optionpop o x take a value in a list stored in the field x of o.
val set_bool : Json_spel_t.json_spel -> string -> bool -> Json_spel_t.json_spelset_bool o x b sets the a field x of the object o with value b.
val get_bool : Json_spel_t.json_spel -> string -> bool optionget_bool o x gets the value of the field x of the object o.
val set_string :
Json_spel_t.json_spel ->
string ->
string ->
Json_spel_t.json_spelset_string o x x sets the a field x of the object o with string s.