setindex
Setindex is a programming concept and, in some languages, a specific function name for assigning a value to a particular position within an indexed collection. The operation is defined for data structures that support indexing, such as arrays, lists, vectors, or other sequence types. In mutable containers, setindex typically updates the element in place; in immutable containers, the operation may return a new container with the updated element.
In practice, the mechanics vary by language. In Julia, the canonical form is setindex!(collection, value, index),
A related limitation is that setindex presumes the container has a defined notion of positions. For mathematical
Common considerations include performance, with direct indexed updates often O(1) for arrays and O(n) or higher