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

current_array(?Array, ?Options)

Succeeds if there exists an array as denoted by Array and with type and visibility as given in the list Options.

?Array
Atom or compound term.
?Options
List whose first element is one of the atoms real, integer, byte or prolog and whose second element is one of the atoms local or global.

Description

current_array/2 is used to retrieve information about existing visible arrays and global variables. Array is a term denoting the array's name and dimensions and Options is a list describing the array's type and visibility.

Fail Conditions

Fails if there is no (further) array whose name unifies with ArrayName, dimension list with ListOfBounds and type with Type.

Resatisfiable

Yes.

Exceptions

(5) Type error
Array is neither variable, atom nor compound term.
(5) Type error
Options is neither a list nor a variable.

Examples


[eclipse 1]: make_array(a(2)), make_local_array(b(2,3,4), real).

yes.
[eclipse 2]: current_array(a(Size), [Type,Vis|_]).

Size = 2
Type = prolog
Vis = global
yes.
[eclipse 3]: current_array(Array, Props).

Array = a(2)
Props = [prolog, global]     More? (;)

Array = b(2, 3, 4)
Props = [real, local]     More? (;)

no (more) solution.

Error:
      current_array("a", L).    (Error 5).
      current_array(a, 9).      (Error 5).

See Also

make_array / 1, make_array / 2, make_local_array / 1, make_local_array / 2