Data and Math
vcollections
Deques, counters, ordered maps and named records, the containers programs reach for.
Released v1.0.0 · 2026-09-28use "stdlib/collections.ven"
d = deque_new()
deque_push_back(d, 1)
deque_push_front(d, 0)
print deque_length(d)
Reference (24 functions)
API reference
deque_pop_back(d)
Removes and gives back the value at the back of d.
d = deque_new()
deque_push_back(d, 1)
deque_pop_back(d)deque_pop_front(d)
Removes and gives back the value at the front of d.
d = deque_new()
deque_push_back(d, 1)
deque_pop_front(d)deque_peek_back(d)
Gives back the value at the back of d without removing it.
d = deque_new()
deque_push_back(d, 1)
deque_peek_back(d)deque_peek_front(d)
Gives back the value at the front of d without removing it.
d = deque_new()
deque_push_back(d, 1)
deque_peek_front(d)deque_to_list(d)
Gives back ds elements as a plain List, front to back.
d = deque_new()
deque_push_back(d, 1)
deque_to_list(d)Counter: value to occurrence count
counter_from(items)
Builds a value-to-occurrence-count Map from items.
counter_from(["a", "b", "a", "c", "a", "b"])counter_most_common(counter, n)
Gives back the n most frequent (value, count) pairs in counter, highest count first.
c = counter_from(["a", "b", "a", "c", "a", "b"])
counter_most_common(c, 2)counter_total(counter)
Gives back the sum of every occurrence count in counter.
c = counter_from(["a", "b", "a", "c", "a", "b"])
counter_total(c)named_tuple_new(field_names, values)
Builds a Map pairing each name in field_names with the value at the same position in values.
named_tuple_new(["x", "y"], [3, 4])chunked_deque_new()
A new, empty ChunkedDeque.
chunked_deque_to_list(cd)
cd's elements as a plain List, front to back.
chunked_deque_from_list(items)
Builds a ChunkedDeque from every element of items, in order.