Nothing

Nothing

represents an element of a list that will automatically be removed.

Nothing[]

gives Nothing.

Details

  • Nothing is removed as part of the standard evaluation process. It is not removed in expressions that are held or inactive.

Examples

open allclose all

Basic Examples  (2)

Any occurrence of Nothing is automatically removed in a list:

Replace an element of a list with Nothing to remove it:

Scope  (2)

Nothing is removed wherever it appears in a list:

Nothing is not removed from heads other than List:

Generalizations & Extensions  (1)

When Nothing appears as a head, it reduces any expression to Nothing:

Applications  (1)

Delete lines from a plot, leaving only isolated points:

Properties & Relations  (3)

Nothing is removed during the standard evaluation process:

Remove primes from a list by replacing them with Nothing:

Delete the primes with a pattern:

Select the non-primes:

Nothing will only disappear inside lists:

An empty Sequence[] will evaporate inside any head except those with special attributes:

Possible Issues  (1)

Nothing is removed as part of standard evaluation, so it is kept in held expressions:

When the Hold is released, Nothing is removed:

Introduced in 2015
 (10.2)
 |
Updated in 2016
 (10.4)