[ Non-logical Variables, Arrays, Bags, Shelves and Stores | Reference Manual | Alphabetic Index ]

# erase_array(++ArraySpec)

Erases existing visible array or non-logical variable.

ArraySpec
  Of the form Atom/Integer or just atom.

## Description

Used to erase the visible array uniquely specified by ArraySpec.

Also used to erase the existing non-logical variable ArraySpec, if ArraySpec is of the form Atom/0, or just Atom.

Erasing reclaims the memory occupied by the array or variable.

Note: Up to ECLiPSe version 6.1 this predicate worked also on references.

### Modes and Determinism

- erase_array(++) is det

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

### Exceptions

(4) instantiation fault
  ArraySpec is not instantiated.
(5) type error
  ArraySpec is not an atom or of the form Atom/Integer.
(41) array or global variable does not exist
  ArraySpec specifies an array or variable which does not exist.

## Examples

    Success:
          local(array(a(4,3))), erase_array(a/2).
          setval(i,1), erase_array(i).
          setval(i,1), erase_array(i/0).

    Error:
          erase_array(X).                  (Error 4).
          local(array(a(4,2))),
              erase_array(a(4,2)).         (Error 5).
          erase_array(no_array/1).         (Error 41).
          erase_array(no_array).           (Error 41).

## See Also

current_array / 2, array / 1, array / 2, variable / 1, setval / 2