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

make_local_array(+Array)

Creates an array or global variable Array visible only in the caller module.

+Array
Atom or Ground compound term with integer arguments.

Description

If Array is an atom, a global variable only visible from the caller module is created. Its value is initialised to a free variable.

If Array is a compound term, a local array of type prolog is created, its dimension is the arity of the term Array and the size of each dimension is specified by the corresponding argument of the term Array. The elements of arrays of type prolog are initialised to free variables.

Note make_local_array(A) is equivalent to make_local_array(A, prolog).

Fail Conditions

None.

Resatisfiable

No.

Exceptions

(4) Instantiation fault
Array is not ground.
(5) Type error
Array is not an atom or a structure with integer arguments.
(6) Range error
The ground structure Array has arguments that are integers not greater than 0.
(42)
A local array with the same name and dimension as Array already exists.

Examples


Success:
      make_local_array(a).
      make_local_array(a(1)).
      make_local_array(a(4)).
      make_local_array(b(2,3)).
      make_local_array(a(4)), make_local_array(a(4,1)).
      make_local_array(a), make_local_array(a(1)).

Error:
      make_local_array(X).              (Error 4).
      make_local_array(a(6.0)).         (Error 5).
      make_local_array(a(0)).           (Error 6).
      make_local_array(a(-2)).          (Error 6).
      make_local_array(a(4)),
          make_local_array(a(5)).       (Error 42).

See Also

current_array / 2, decval / 1, incval / 1, make_array / 1, make_array / 2, make_local_array / 2, getval / 2, setval / 2