next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: delete

delete -- delete some elements of a list

Synopsis

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.

See also

For the programmer

The object delete is a function closure.