diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-04-01 15:02:37 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-04-01 15:02:37 +0000 |
commit | f7c9cc679520834d36acc7a1fc666f2a052fce69 (patch) | |
tree | e112e12dd7db2620b5fcfa761c4d37977877eec6 /NEWS | |
parent | 02cc930297b1c3b375e35032e47c1e66f4e9e712 (diff) | |
download | mailfromd-f7c9cc679520834d36acc7a1fc666f2a052fce69.tar.gz mailfromd-f7c9cc679520834d36acc7a1fc666f2a052fce69.tar.bz2 |
Implement loop statement
git-svn-id: file:///svnroot/mailfromd/trunk@1337 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 50 |
1 files changed, 50 insertions, 0 deletions
@@ -7,6 +7,56 @@ Please send mailfromd bug reports to <bug-mailfromd@gnu.org.ua> Version 3.1.91, SVN +* next and pass + +Use `pass' instead of `next'. + +The `next' keyword has changed its semantics: it is now used to +resume the next iteration of the enclosing loop statement (see +below). + +For compatibility with the previous versions, its use outside of a +loop statement is still allowed, but a warning is issued. You are +enouraged to replace all occurrances of `next' in your confifuration +scripts with `pass'. + +* Loop + +The loop statement is implemented. Its syntax is: + +loop [name] + [for <stmt>,] [while <stmt>,] [<stmt>] +do + ... +done [while <stmt>] + +* break and next + +The `break' statement exits from the enclosing loop. + +The `next' statement resumes the next iteration of the enclosing loop +statement. + +Both statements take an optional argument specifying the identifier +(name) of the loop to break from (or continue), this allows to build +complex iterations consisting of nested loops. For example, in this +code (line numbers added for clarity): + + 1 loop outer for set i 1, while %i < %N + 2 do + 3 ... + 4 loop for set j 1, while %j < %i + 5 do + 6 if foo(%j) + 7 break outer + 8 fi + 9 done +10 done +11 accept + +if the call to `foo' in line 6 returns true, the control is immediately passed +to `accept' in line 11. + * Resizable stack The runtime stack of the MFL grows automatically as the need arises. |