rum icon indicating copy to clipboard operation
rum copied to clipboard

data struct

Open avelino opened this issue 7 years ago • 0 comments

(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 is int
    • setTestAvelino.age is string
  • Possibility to create new tags (example type), so the extensible structure, example: json tag (Initially we will not have json, was placed as an example)

avelino avatar Nov 20 '17 06:11 avelino