moonscript
moonscript copied to clipboard
Need nop/pass statement
Consider the following lua statement:
for l=1,2 do end
How to perfectly translate this into moonscript?
We need a statement that does nothing, like pass in Python and nop in asm. end is a perfect choice.
--pass works fine.
while sth()
--pass
OK, this specific case might work, but consider this one: https://gist.github.com/buckle2000/bb2999b31706b70f767d53a8a7230661
and this one:
for l=1,2
-- pass
You can already sort of do this:
for l=1,2
pass
Since pass is likely undefined, that will just end up evaluating to nil. Even if it is defined, this wouldn't really do anything.
Very true, but this is somewhat unsatisfying since there is an additional statement.
local _ = pass
I tend to use nil in this scenario, but it still generates the blank assignment