| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |
foreach varName aList aBlock
Executes a block of code for each of the elements in a list.
aBlock that that will take the value of each of the elements
in the list.
aList.
aBlock
or the null object if aBlock never is executed.
foreach function executes aBlock
as many times as the number of elements in aList.
Every time aBlock gets executed a variable
identified by the symbol varName is initialized
inside aBlock with a reference to one of the
elements in aList, in the
same order they appear in aList.
If you ignore the return value you could define the
foreach function like this:
define foreach ( varName aList aBlock ) {
map [lambda ( $varName ) $aBlock] $aList
}
| Overview | Module | Function | Class | Tea 3.2.5 Reference Documentation © 2009 PDM&FC |