[ ECLiPSe Arrays and Global Variables built-in.|Group Index| Full Index]

erase_array(+ArraySpec)

Erases existing visible array or global variable specified by ArraySpec.

+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 global variable ArraySpec. ArraySpec is of the form Atom/0, or just Atom.

Erasing reclaims the memory occupied by the array or variable. Moreover, erasing a local one may expose a global of the same name

Fail Conditions

None.

Resatisfiable

No.

Exceptions

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

Examples


Success:
      make_array(a(4,3)), erase_array(a/2).
      make_array(a(2)),
          make_local_array(a(2)),
          erase_array(a/1), % erase local array.
          erase_array(a/1). % erase global array.
      setval(i,1), erase_array(i).
      setval(i,1), erase_array(i/0).

Error:
      erase_array(X).                  (Error 4).
      make_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, make_array / 1, make_array / 2, make_local_array / 1, make_local_array / 2, setval / 2