comparison Doc/lib/libarray.tex @ 29163:2bb5ceef9ac3 legacy-trunk

Fix array.array.insert(), so that it treats negative indices as being relative to the end of the array, just like list.insert() does. This closes SF bug #739313.
author Walter Dörwald <walter@livinglogic.de>
date Sun, 18 May 2003 03:15:10 +0000
parents c019aa827f86
children 35f56e08727f
comparison
equal deleted inserted replaced
29162:384bda343725 29163:2bb5ceef9ac3
143 the first occurence of \var{x} in the array. 143 the first occurence of \var{x} in the array.
144 \end{methoddesc} 144 \end{methoddesc}
145 145
146 \begin{methoddesc}[array]{insert}{i, x} 146 \begin{methoddesc}[array]{insert}{i, x}
147 Insert a new item with value \var{x} in the array before position 147 Insert a new item with value \var{x} in the array before position
148 \var{i}. 148 \var{i}. Negative values are treated as being relative to the end
149 of the array.
149 \end{methoddesc} 150 \end{methoddesc}
150 151
151 \begin{methoddesc}[array]{pop}{\optional{i}} 152 \begin{methoddesc}[array]{pop}{\optional{i}}
152 Removes the item with the index \var{i} from the array and returns 153 Removes the item with the index \var{i} from the array and returns
153 it. The optional argument defaults to \code{-1}, so that by default 154 it. The optional argument defaults to \code{-1}, so that by default