Generic dynamic array (Vec[T]) and hash map (HashMap[K, V]) data structures.
A growable, heap-allocated array.
struct Vec[T]:
let data: String
let len: Int
let cap: IntA hash map with generic key and value types.
struct HashMap[K, V]:
let keys: String
let values: String
let len: Int
let cap: IntCreates a new empty vector.
Appends val to the end of the vector. Automatically grows the capacity.
Retrieves the element at index. Returns Some(val) if the index is valid, None otherwise.
Returns the number of elements in the vector.
Returns true if the vector contains no elements.
Creates a new empty hash map.
load std.collections
let vec = collections.new_vec[Int]()
let vec = collections.push(vec, 42)
let val = collections.get(vec, 0) # Some(42)
let map = collections.new_map[String, Int]()