Home / Docs / Standard library / Built-in methods
items
A built-in method, resolved by the type of its receiver (spec/14 §2). Edition 0.5 preview.
s.items() -> List[T]
where s: Stack[T]
q.items() -> List[T]
where q: Queue[T]
s.items() -> List[T]
where s: Set[T]
s.items() -> List[T]
where s: HashSet[T]
q.items() -> List[T]
where q: PriorityQueue[T, P]
b.items() -> List[Int]
where b: BitSetThe items as a list: a Stack top first and a Queue front first, as many as its len, in O(n) time (spec/28 §5); a Set's in ascending order, as many as its len, in O(n) time (spec/28 §6); a HashSet's in the order its items were first added, in O(n) time (spec/28 §7); a PriorityQueue's in the order of the pops, in O(n log n) comparisons (spec/28 §8); a BitSet's members in ascending order, in O(size / 64 + len) time (spec/28 §9).
Specification
spec/28 §5spec/28 §6spec/28 §7spec/28 §8spec/28 §9
Generated from una v0.4.0 (docs/std/builtins.json, which is not part of the specification): built-in methods have no declaration, so una writes these signature lines and tests each against its checker. The specification governs: spec/14 §2.