|
2012-05-28
| ||
| 19:12 | • Ticket [3530185fff] New post-test loops: do ... while/until ... status still... artifact: e177b3bfcf user: twylite | |
| 19:11 | • Ticket [3530185fff]: 5 changes artifact: 07af46476f user: dkf | |
| 18:46 | • Closed ticket [3530185fff]. artifact: 93f2de28d7 user: ferrieux | |
| 06:58 | • New ticket [3530185fff]. artifact: 64a9a5c780 user: zoltan3 | |
New post-test loops: do ... while/until ...
Closed / Rejected3530185fffffffffffffffffffffffffffffffffCreated 15 years agoUpdated 15 years ago
Descriptionplain2012-05-28 06:58:17
It is easy to construct a post-test loop on the ground of while:
while {TEST} {...}; --> while 1 {...; if {!TEST} {break}};
But it would be nice if we could use explicit post-test loops.
ferrieuxplain2012-05-28 18:46:18
Orthogonality is an important principle behind carefully designed languages like Tcl. Bloating the core language for something which is so easily emulated in script is a bad idea. If you want a language where dozens of ways exist to do the same thing, all supported by specific built-in syntaxes, there are several options on the market...
dkfplain2012-05-28 19:11:45
See [control::do] in the control package of Tcllib, and explain why it needs to be in the Tcl core itself... http://tcllib.sourceforge.net/doc/control.html
twyliteplain2012-05-28 19:12:43
A construct equivalent to the described post-test loop can be implemented in Tcl using [uplevel]. See for example [control::do] in http://tcllib.sourceforge.net/doc/control.html.
Log in (anonymous is fine) to add a comment.