3 ms·
Lua actually has a very odd syntax in that statements don't have to be separated by any particular whitespace. x = 1 y = 2 and x = 1; y = 2 and
by jcromartie 18y ago
Lua actually has a very odd syntax in that statements don't have to be separated by any particular whitespace.
x = 1
y = 2
and
x = 1; y = 2
and
x = 1 y = 2
are all equivalent.
I actually don't mind this. I've never encountered a situation where this style makes the meaning of the code undecidable.
- silentbicycle 18y agoThe main Lua book points out that such code is "ugly, but valid", and leaves it at that. It seems to me that "x, y = 1, 2" would be cleaner, if someone were determined to make it a one-liner.