(text json mutable) - Mutable JSON

Library (text json mutable)

This library provides an mutable JSON representation.

The following example shows how to use:

(import (rnrs)
        (text json mutable))

(define json '#(("key" . "value")))
(define mutable-json (json->mutable-json json))

(mutable-json-object-set! mutable-json "key" '#(("value" . "as object")))

(mutable-json->json mutable-json)
;; -> #(("key" . #(("value" . "as object"))))
Function json->mutable-json json

Converts the given json to a mutable JSON.

Function mutable-json->json mutable-json

Converts the given mutable-json to a JSON.

Function mutable-json? obj

Returns #t if the given obj is a mutable JSON, otherwise #f.

Mutable JSON object consists with 2 containers

Mutable JSON object

Mutable JSON object is a JSON object. The difference is a mutable JSON object doesn't allow to have multiple identical keys while JSON object allows it.

Returns #t if the given obj is a mutable JSON object, otherwise #f.

Associates the given key and value to the mutable-json.

Merges the mutable-json-object1 and mutable-json-object* into mutable-json-object.

Remves the given key from the mutable-json-object.

Returns #t if the given key exists in the mutable-json-object, otherwise #f.

Returns the value associated with the given key in the mutable-json-object, otherwise returns mutable JSON not foundobject.

Returns #t if the given obj is a mutable JSON not found, otherwise #f.

Mutable JSON array

Mutable JSON array is a JSON array with capability of expansion or shrinking.

Returns #t if the given obj is a mutable JSON array otherwise #f.

Sets the given value value to the _mutable-json-array_on position of index.

Insets the given value value to the _mutable-json-array_on position of index.

Deletes the value of given _mutable-json-array_on position of index and shrink it.

Retrieves the value of mutable-json-array on position of index.

Returns the size of the given mutable-json-array.