Changes between Version 3 and Version 4 of Opihi_Shell_Language
- Timestamp:
- Aug 16, 2009, 10:53:49 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Opihi_Shell_Language
v3 v4 160 160 Opihi has several types of flow-control features. These include for-loops, while-loops, if-else blocks. These blocks are defined by the corresponding command (`for, while, if`) and are terminated with by a line with the single word `end`. 161 161 162 ==== For loops === 162 ==== For loops ==== 163 163 164 164 The for-loop syntax is simplistic. The for command specifies the loop variable, the starting value, the ending value, and optionally the delta for each loop. The implicit loop test is always to check if the loop variable is still less than the end value (or greater than if the delta value is negative). The definitions of this loop syntax and the value of the list length (`$list:n`) and the vector length (`vector[]`) make for natural loops over all elements of a list or vector. Below are a few examples:
