# delete -- delete some elements of a list

## Synopsis

• Usage:
delete(x, A)
• Inputs:
• A, list or sequence
• x, thing
• Outputs:
• A2, a new list from A with every occurrence of x removed

## Description

 i1 : delete(c, {a,b,c,d,e,a,b,c,d,e}) o1 = {a, b, d, e, a, b, d, e} o1 : List

Equality is determined with ===, which is quick, but not always intuitive. For instance, in the next example, the first item in the list is not removed, because it is an element of QQ and will not match an element of ZZ.

 i2 : delete(1, {2/2, 3/2, 4/2}) 3 o2 = {1, -, 2} 2 o2 : List

To delete items from a list by index, rather than value, see drop.

• drop -- drop some elements from a list or sequence.
• positions -- which elements of a list satisfy a condition
• select -- select from a list, hash table, or string
• lists and sequences -- a detailed overview of lists and sequences in Macaulay2

## For the programmer

The object delete is .