summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-06-13 06:55:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-06-13 07:53:24 -0700
commitbe4b8ea34756ac7b13c182573c952c21e4c11777 (patch)
tree27df39f8fe22541e975e8966ac0a232e48f032bc /eval.c
parentecb2cd4a54505d3068cad1faa9bf02c28162bc55 (diff)
downloadtxr-be4b8ea34756ac7b13c182573c952c21e4c11777.tar.gz
txr-be4b8ea34756ac7b13c182573c952c21e4c11777.tar.bz2
txr-be4b8ea34756ac7b13c182573c952c21e4c11777.zip
for/for*: stricter syntax check.
* eval.c (me_for): Require at least one argument. However, we let the init-forms continue to be optional and document it. * txr.1: Refer to for and for* as macros, since they have been since 2016. The omission of the inc-form list is shown as a second variant of the syntax. This is to avoid misleading the reader into thinking that the the inc-form list can be omitted while body forms are present. A spurious paragraph reiterating that the macros establish an anonymous block is removed. That extra text was present in the first draft written in 2011, and maintained since. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 4053f8eb..7f207de9 100644
--- a/eval.c
+++ b/eval.c
@@ -3215,7 +3215,7 @@ static val me_each(val form, val menv)
static val me_for(val form, val menv)
{
val forsym = first(form);
- val args = (syn_check(form, forsym, cdr, 0), rest(form));
+ val args = (syn_check(form, forsym, cddr, 0), rest(form));
val vars = first(args);
val body = rest(args);
int oldscope = opt_compat && opt_compat <= 123;