Jeroen Demeyer on Mon, 25 Aug 2008 10:00:57 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: removing an item from a list


Adam Sikora wrote:
Does anyone know if there is a pari-gp function for removing an item
from a list in pari-gp?  Something opposite to listinsert().
 (I know that I could write one myself, but it would have slower
execution time and time optimization is important for me).

listpop() does what you want:

gp> ?listpop
listpop(list,{n}): removes n-th element from list. If n is omitted or greater than the current list length, removes last element.