JSON¶
dict-space¶
Type
(-> Expression Grounded)
Description
Function takes key-value pairs in form of expression as input, creates space and adds key-value pairs into it
Parameters
Expression - Expression
Returns
Grounded Space
get-keys¶
Type
(-> Grounded Atom)
Description
Function takes space and returns all keys from (
Parameters
Grounded - Space
Returns
Atom All keys in the input space
get-value¶
Type
(-> Grounded Atom %Undefined%)
Description
Function takes space and key as input, checks if space contains key-value pairs in form of (key value) and returns value tied to the input key
Parameters
Grounded - Space
Atom - Key
Returns
%Undefined% Value which tied to input key, empty if no such key in space
json-decode¶
Type
(-> String Atom)
Description
Function takes json string as an input and decodes it to the metta objects (list to expression, dictionary to space which will contain key-value pairs in form of (key value), string to string, number to number)
Parameters
String - Json string
Returns
Atom Metta object
json-encode¶
Type
(-> Atom String)
Description
Function takes atom as an input and encodes it to json-string. Atom could be a string, number, expression, space and combination of those
Parameters
Atom - Input atom
Returns
String Json string