Collections

Lists

A dynamically sized array of elements of Type T.

Declaration

list[num] numbers = [1, 2, 3];
list[char] chars = ['a', 'b', 'c'];

Access

Access is strictly checked. .at(index) returns a rox_result[T].

rox_result[num] res = numbers.at(0);
if (isOk(res)) {
    num val = getValue(res);
}

Methods

Dictionaries

A key-value map of elements of Type K and V.

Declaration

dictionary[num, string] d;
d.set(1, "one");

dictionary[string, num] scores;
scores.set("player1", 100);

Verification

Access returns a rox_result[V] which must be checked.

rox_result[string] res = d.get(1);
if (isOk(res)) {
    string val = getValue(res);
}

Methods