Name
foreach — Processes the content of a list
Synopsis
any
foreach
( |
any
VAR
, |
|
list
LIST
, |
|
block
EXPR
) ; |
Parameters
-
any
VAR
-
list
LIST
-
block
EXPR
Return
-
any
return value of last execution of EXPR
Description
For each element of the list LIST
the expression EXPR
is executed in a new context, where the variable VAR
is assigned to that value. The return value of the last execution of EXPR
is the value of the foreach
construct.
Usage
foreach (integer v, [1,2,3], { return v + 10; }) -> 13