[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Numeric for loop: Changing control variable REALLY dangerous?
- From: bil til <biltil52@...>
- Date: Sat, 10 Dec 2022 08:10:45 +0100
In chapter 3.3.5, there is a bit a "strange sounding" warning:
"You should not change the value of the control variable during the loop."
... is this not a bit "over-cautious"?
e. g. in a typical loop "for i=1,count do ... end", it is quite often
really useful to repeat a loop sequence by "i=i-1", or to repeat
complete loop by "i=1" assignment.
This REALLY can be dangerous? (or can give anybody possibly give some
illegal / "bad-running" example for such change?)