Json module

json_set

procedureextensionSource

Sets a member of an object, replacing the last member with that key; object takes ownership of value and copies key.

Example↗
object := json_object();
json_set(*object, "n", json_int(1));
json_set(*object, "n", json_int(2));
assert(json_count(*object) == 1);
free_json(*object);
json_set :: (object: *Json_Value, key: string, value: Json_Value)

Sets a member of an object, replacing the last member with that key; object takes ownership of value and copies key.

Parameters

object: *Json_Value
key: string
the member name.
value: Json_Value
moved into object, which owns it from then on.
Example↗
object := json_object();
json_set(*object, "n", json_int(1));
json_set(*object, "n", json_int(2));
assert(json_count(*object) == 1);
free_json(*object);

See also