Atom

clear()

Empties an ordinary collection, zeroes packed storage or produces empty text.

Signature

clear(value)

Parameters

Mutable ordinary collection, packed value, char or string.

Returns

The same collection or packed value, or an empty string.

Behavior

Packed values keep their shape and number of entries. Clearing a view updates its owner's selected region. Text is immutable.

Errors

Read-only or unsupported value, or invalid packed view.

Example

Atom
a = [1]
assert(clear(a) == a and count(a) == 0)