-
Notifications
You must be signed in to change notification settings - Fork 0
The JSON Standard Library
C272 edited this page Aug 30, 2019
·
4 revisions
Facilitates the serializing and deserializing of Algo to JSON (JavaScript Object Notation).
Serializes an Algo object or list to JSON, providing none of the object members are unsupported types. The list of supported types is as follows:
- Object
- List
- String
- Integer
- Float
- Rational
- Boolean
- Null
Parameters:
Name | Description |
---|---|
val | The object or list to serialize to JSON. |
Usage:
let obj = object
{
let x = 3;
let y = "example";
let z = [1, 2];
}
let someJSON = json.make(obj); //{ x:3, y:"example", z:[1, 2]}
Parses a JSON string to an Algo object.
Parameters:
Name | Description |
---|---|
str | The JSON string to parse to Algo object. |
Usage:
let x = json.parse("{ x: 3 }");
//x has one property, x, that has value 3.
Algo (c) Larry Tang, 2019.
Commercial use of Algo must include the LICENSE
file in the same directory as the executable.
Standard Library Documentation: