next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: replace(ZZ,Thing,VisibleList)

replace(ZZ,Thing,VisibleList) -- copy a list, replacing an element

Synopsis

Description

A negative value of i is taken relative to the end of the list.

i1 : replace(4,   t, 0..10)

o1 = (0, 1, 2, 3, t, 5, 6, 7, 8, 9, 10)

o1 : Sequence
i2 : replace(0,   t, 0..10)

o2 = (t, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

o2 : Sequence
i3 : replace(10,  t, 0..10)

o3 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, t)

o3 : Sequence
i4 : replace(-1,  t, 0..10)

o4 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, t)

o4 : Sequence
i5 : replace(-11, t, 0..10)

o5 = (t, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

o5 : Sequence