is_in_list()
Predicate that checks if an item is in a list.
Synopsis
is_in_list(list-expression, expression)
Description
This expression evaluates to true if the value of the list expression parameter contains an item with a value matching the second argument.
Parameters
list-expression
The list being checked.
expression
The value to search the list for.
Returns
True (\(1\)) if the value of the list-expression
has an item whose
value is expression
. False (\(0\)) otherwise.
Examples
If there is a list of agents, Agent_List
, then the following conditional
applies only to agents whose id
is in the list:
if (is_in_list(Agent_List, id)) then ...