Macaulay2 » Documentation
Packages » Macaulay2Doc :: delete
next | previous | forward | backward | up | index | toc

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

Ways to use delete :

For the programmer

The object delete is a method function.