Originally Posted by Malakahh
Code:
--Removing this if statement causes something called a Tail Call (this is new to me as well), which will result in "zero" and "one" getting output, but not file2.
if 1 == 1 then
return
end
|
I didn't notice the comment before, but it's incorrect. Following my explanation earlier, removing the conditional surrounding the
return statement will cause Lua to throw a syntax error since the
return is no longer appearing at the end of a chunk.
Also using a conditional that always evaluates as true can be replaced with the following code for faster execution.
Forcing
return into a
do ... end bypasses the syntax error since it is at the end of the chunk.
Note whitespace is irrelevant to Lua, so the previous code could be written as this to make it better to read.