
index_val   -   indexed   access   of   the   value   without

evaluation

Calling sequence:

index_val(expr, expr_1 ...)

Parameter:

expr, expr_1  --   expressions

Overloading:

1

Summary:

index_val permits indexed access to arraysand tableswithout the returned
value being subsequently evaluated. (Normally table and array elements are
re-evaluated when the index operator "[ ]\ is used; see page ??.) Sometimes
it is desirable to prevent this -- under certain conditions very time-consuming
-- evaluation. For this purpose the function index_val can be used.

Similar to the underline function _index, index_val enables the user access
to tables, arrays, listsand expression sequences. (For reasons of consistency
lists and expression sequences are treated as with _index.) The arguments
are also given as with _index: the first argument is the data structure, to be

accessed (a table, list expression sequence or an array). The other arguments
are used as indexes.

If the user wishes to use the function index_val for indexed access then this
can be achieved with the assignment _index := index_val;.  After this
assignment has been given then the function index_val is always used when
indexed accessing with the index operator is carried out.  index_val is a
kernel function.

>>  a := array(1..2, 1..2, (1,2)=x): x := 3:
    a[1,2], index_val(a, 1, 2);

      3, x

See also:  val

