rum
rum copied to clipboard
data struct
(struct test
(name (:type string) (:json "123 testando"))
age
(langs (:type array)))
(let setTest (test (name "Avelino") (age 10) (langs (array("rum", "golang", "python")))))
(let setTestAvelino (test (name "Avelino") (age "oito") (langs (array("rum", "golang", "python")))))
fields
- Optional use of type, after type set the field cannot be another type
- Fields that did not declare type assumed that it is the first declared type (in use), being able to do what was done in the above example:
-
-
setTest.age
isint
-
-
-
setTestAvelino.age
isstring
-
- Possibility to create new tags (example type), so the extensible structure, example:
json
tag (Initially we will not havejson
, was placed as an example)