diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-04-11 19:22:37 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-04-11 19:22:37 -0700 |
commit | f1a5e50f78927a362f244f0adfc1d23813c93073 (patch) | |
tree | 7a4207a469342a77c0653e9f6041de516af2ba4c /txr.1 | |
parent | 387d9c08e44db206e995bbbf272b7b8ea8580ad7 (diff) | |
download | txr-f1a5e50f78927a362f244f0adfc1d23813c93073.tar.gz txr-f1a5e50f78927a362f244f0adfc1d23813c93073.tar.bz2 txr-f1a5e50f78927a362f244f0adfc1d23813c93073.zip |
Implementing while* and until* loops.
* eval.c (while_star_s, until_star_s): New symbol variables.
(me_while_star, me_until_star): New static functions.
(eval_init): Initialize new variables. Register while* and
until* macros.
* txr.1: Documented while* and until*.
* txr.vim, tl.vim: Regenerated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -10201,6 +10201,36 @@ is if the operator is used to terminate the implicit anonymous block, and is given an argument, which becomes the result value. +.coNP Macros @ while* and @ until* +.synb +.mets (while* < expression << form *) +.mets (until* < expression << form *) +.syne +.desc +The +.code while* +and +.code until* +macros are similar, respectively, to the macros +.code while +and +.codn until . + +They differ in one respect: they begin by evaluating the +.metn form -s +one time unconditionally, without first evaluating +.metn expression . +After this evaluation, the subsequent behavior is +like that of +.code while +or +.codn until . + +Another way to regard the behavior is that that these forms execute +one iteration unconditionally, without evaluating the termination test prior to +the first iteration. Yet another view is that these constructs relocate the +test from the "top of the loop" to the "bottom of the loop". + .coNP Macro @ whilet .synb .mets (whilet ({ sym | >> ( sym << init-form )}+) |