Next: , Previous: , Up: The List Library   [Index]


13.3.2 List Traversal Functions

lt_first

integer lt_first(&, list l, integer &p);

is zero if the l list is empty, non zero otherwise. Sets p to 0. For non zero evaluations the first argument is set to the data in the first position.

lt_last

integer lt_last(&, list l, integer &p);

is zero if the l list is empty, non zero otherwise. Sets p to -1. For non zero evaluations the first argument is set to the data in the last position.

lt_next

integer lt_next(&, list l, integer &p);

is zero if the l list defines no position after p, non zero otherwise. Increments p. For non zero evaluations the first argument is set to the data in the new p position.

lt_previous

integer lt_previous(&, list l, integer &p);

is zero if the l list defines no position before p, non zero otherwise. Decrements p. For non zero evaluations the first argument is set to the data in the new p position.

lt_progress

integer lt_progress(list l, integer &p, &...);

is zero if the l list defines fewer than 2 * n positions after p, non zero otherwise, with n the number of unnamed arguments. Adds n to p. For non zero evaluations sets the unnamed reference arguments to the data in the new p .. p + n - 1 positions. Mismatching data types cause the function to fail, with the previous unnamed arguments remaining modified and p unchanged.

lt_progress’(l, p, x) is equivalent with ‘lt_next’(x, l, p).

lt_regress

integer lt_regress(list l, integer &p, &...);

is zero if the l list defines fewer than n positions before p, non zero otherwise, with n the number of unnamed arguments. Subtracts n from p. For non zero evaluations sets the unnamed reference arguments to the data in the new p .. p + n - 1 positions. Mismatching data types cause the function to fail, with the previous unnamed arguments remaining modified and p unchanged.

lt_regress’(l, p, x) is equivalent with ‘lt_previous’(x, l, p).


Next: List Item Range Functions, Previous: Non Data Type Specific List Functions, Up: The List Library   [Index]