*Local loop control variables* One of the criteria by which we can evaluate the ...

@vnikolov@ieji.de

*Local loop control variables*

One of the criteria by which we can evaluate the design of a programming language is whether each loop control variable may, or even must, be a local variable in its loop construct.
(That means the declaration of the variable is a part of the loop construct and its scope is the construct.)

It took several decades of evolution for programming language designers to realize the usefulness of such a feature.
Old languages provide nothing of the kind.
With many newer languages it is only optional.

Different languages put different amounts of pressure on programmers to use local loop control variables.
In particular, when looking at some programming language:
Is there a standard loop construct where the loop control variable may be non-local?
If not, can programmers implement their own loop constructs where the loop control variables are non-local?

#ComputerProgramming
#ProgLang
#ProgrammingLanguageDesign
#ProgrammingLanguages