I\'m trying to decrement the counter of a for loop as the loop is running. Unfortunately, Lua doesn\'t seem to allow that. This piece of code should run forever:
<
It's by design. From Lua reference manual:
3.3.5 – For Statement All three control expressions are evaluated only once, before the loop starts. They must all result in numbers.
All three control expressions are evaluated only once, before the loop starts. They must all result in numbers.
So modifying the value of i inside the loop won't change how the loop runs.
i