Objects

An object stores a list of values, organized as a dictionary. The type is {}.

a := {x: 1, y: "hi"}

To change a value in an object:

a.x = 2

Alternative:

a["x"] = 2

The value must be of the same type.

If you want to change the type, use :=:

a.x := "hi!"

Insert new keys and values with :=:

a := {}
a.x := 1
a.y := 2
a.z := 3

Some useful functions

  • fn has({}, str) -> bool - return true if object has key
  • fn keys({}) -> [str] - return keys of object