Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

33
Task/JSON/11l/json.11l Normal file
View file

@ -0,0 +1,33 @@
T.serializable Person
String firstName, lastName
Int age
T PhoneNumber
String ntype
String number
[PhoneNumber] phoneNumbers
[String] children
Person p
json:to_object(
{
"firstName": "John",
"lastName": "Smith",
"age": 27,
"phoneNumbers": [
{
"ntype": "home",
"number": "212 555-1234"
},
{
"ntype": "office",
"number": "646 555-4567"
}
],
"children": ["Mary", "Kate"]
}, &p)
p.phoneNumbers.pop(0)
p.children.append(Alex)
print(json:from_object(p))