The only thing I note is that technically a
do …
end is not technically a control structure. Control structures can redirect the sequential nature of the program counter inherently. Even a simple
if …
then …
end control structure can cause the program to jump to the end of the control structure, skipping any code blocks contained within. All of the looping control structures (
while,
repeat and
for) have dramatic impact on the program counter.
do …
end specifically identifies a code block, in fact it is the only way to explicitly declare a code block without the use of a control structure.
I think I cover this pretty thoroughly in
Lua Basics -- Variable Scope, Code Blocks and Control Structures.
Edited by surferpup, 21 January 2014 - 02:13 PM.