foreach(in
,
,
in
,
,
)
where
is a pattern which is normally a variable but can be any term, and
a collection,
, which is optional, is a list of variables in
that are local to each iteration, and
is a callable term. All variables in
's are local variables. The foreach call means that for each combination of values
,
,
, the instance
is executed after local variables are renamed. The call fails if any of the instances fails. Any variable, including the anonymous variable '_', that occurs in
but is not in any
or
is shared by all iterations.
A collection takes one of the following forms: