The for or as construct causes termination when the end of the list is reached. This construct initializes the variable var by setting it to the result of evaluating expr1 on the first iteration, then setting it to the result of evaluating expr2 on the second and subsequent iterations. If expr2 is omitted, the construct uses expr1 on the second and subsequent iterations. This construct does not provide any termination conditions. This construct binds the variable var to the value of each element in the array vector .
Iteration stops when there are no more elements in the specified array that can be referenced.
This construct iterates over the elements, keys, and values of a hash table. The variable var takes on the value of each hash key or hash value in the specified hash table. The following loop keywords serve as valid prepositions within this syntax. These loop keywords access each key entry of the hash table. If the name hash-value is specified in a using construct with one of these loop methods, the iteration can optionally access the keyed value.