index_values()
List function that returns the list of the index values that satisfy the given test.
Synopsis
index_values(list-expression, operator, expression)
Description
List function that returns the list of the index values that satisfy the given test.
Parameters
list-expression
list the funciton is applied to.
operator
mathematical comparison operator:
<
,<=
,>
,>=
,==
, or!=
.expression
expression that
<op>
is applied to in relation to<list_expr>
.
Returns
Sub-list of the index values that satisfy the given test.
Examples
The following results in index_list
equal to list(1,2,4)
:
old_list = list(2,10,8,4,6)
index_list = index_values(old_list, >, old_list[0] + 3)
Errors
Use of the prefix form, such as gt
rather than infix form >
, for <op>
results in an error.