next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > lists and sequences > BasicList # ZZ

BasicList # ZZ -- get element from list

Synopsis

Description

The entries of the list are numbered starting with 0. If i is negative, then the i-th entry counting from the end is provided. If i is out of range, an error is signaled.

Assignment to x#i can change the value if x is mutable, i.e., an instance of the class MutableList.

i1 : x = a .. z

o1 = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x,
     ------------------------------------------------------------------------
     y, z)

o1 : Sequence
i2 : x#12

o2 = m

o2 : Symbol
i3 : y = new MutableList from x

o3 = MutableList{...26...}

o3 : MutableList
i4 : y#12 = foo

o4 = foo

o4 : Symbol
i5 : toSequence y

o5 = (a, b, c, d, e, f, g, h, i, j, k, l, foo, n, o, p, q, r, s, t, u, v, w,
     ------------------------------------------------------------------------
     x, y, z)

o5 : Sequence

See also