Jump to content

Variable declaration reset: Difference between revisions

m
(K)
Line 435:
 
But of course, there's no variables here.
 
Longhand loops can be emulated, using lambdas (in which case local variables expire when the lambda exits), but this is not what many programmers would think of as a straightforward longhand loop.
 
=={{header|Nim}}==
In Nim, a loop create a new block. Variables declared in the loop body are created and initialized at each round: they do not retain the value from one round to the next.
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.