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> | |||
7 | 7 | ||
8 | Version 3.1.91, SVN | 8 | Version 3.1.91, SVN |
9 | 9 | ||
10 | * next and pass | ||
11 | |||
12 | Use `pass' instead of `next'. | ||
13 | |||
14 | The `next' keyword has changed its semantics: it is now used to | ||
15 | resume the next iteration of the enclosing loop statement (see | ||
16 | below). | ||
17 | |||
18 | For compatibility with the previous versions, its use outside of a | ||
19 | loop statement is still allowed, but a warning is issued. You are | ||
20 | enouraged to replace all occurrances of `next' in your confifuration | ||
21 | scripts with `pass'. | ||
22 | |||
23 | * Loop | ||
24 | |||
25 | The loop statement is implemented. Its syntax is: | ||
26 | |||
27 | loop [name] | ||
28 | [for <stmt>,] [while <stmt>,] [<stmt>] | ||
29 | do | ||
30 | ... | ||
31 | done [while <stmt>] | ||
32 | |||
33 | * break and next | ||
34 | |||
35 | The `break' statement exits from the enclosing loop. | ||
36 | |||
37 | The `next' statement resumes the next iteration of the enclosing loop | ||
38 | statement. | ||
39 | |||
40 | Both statements take an optional argument specifying the identifier | ||
41 | (name) of the loop to break from (or continue), this allows to build | ||
42 | complex iterations consisting of nested loops. For example, in this | ||
43 | code (line numbers added for clarity): | ||
44 | |||
45 | 1 loop outer for set i 1, while %i < %N | ||
46 | 2 do | ||
47 | 3 ... | ||
48 | 4 loop for set j 1, while %j < %i | ||
49 | 5 do | ||
50 | 6 if foo(%j) | ||
51 | 7 break outer | ||
52 | 8 fi | ||
53 | 9 done | ||
54 | 10 done | ||
55 | 11 accept | ||
56 | |||
57 | if the call to `foo' in line 6 returns true, the control is immediately passed | ||
58 | to `accept' in line 11. | ||
59 | |||
10 | * Resizable stack | 60 | * Resizable stack |
11 | 61 | ||
12 | The runtime stack of the MFL grows automatically as the need arises. | 62 | The runtime stack of the MFL grows automatically as the need arises. |