Skip to main content

Module json

Module json 

Source
Expand description

JSON parse + stringify, mapping to the tatara-lisp Value tree.

(json-parse STR) → nested Value (null → nil, objects → alist) (json-stringify V) → string (alist-get ALIST KEY) → value at KEY, or nil (alist-get ALIST KEY DEFAULT) → value at KEY, or DEFAULT

Functions§

install
json_to_value
Convert a serde_json::Value into a tatara-lisp Value. Objects become association lists: ((key . v) (key . v) ...) where each pair is a 2-element list for easy alist-get lookup.
value_to_json
Convert a tatara-lisp Value into a serde_json::Value for serialization. Closures / native fns / foreign / quoted-sexp collapse to null.