Page 1 of 1

tbl = { "1", "2", "3", } acceptable, Bug or not?

Posted: Wed Jan 21, 2026 4:37 pm
by Bugala
Here is an example:

Code: Select all

tbl = { "1", "2", "3", }
Point here being that after "3" there is still one comma "," and this works fine, but should it?

Personally I think it is excellent it does work this way, since quite often I notice I tend to accidentally leave the last comma there, and which in addition happens to be useful when i decide to add one more thing to the last place in case items are in different lines.

But, should I actually keep an eye more carefully in these and remove the extra commas, or is this going to be fine in the future too?

Re: tbl = { "1", "2", "3", } acceptable, Bug or not?

Posted: Thu Jan 22, 2026 3:13 pm
by jPV
It's optional, but perfectly valid, in Lua specs too, so I think it's just fine to use it also in Hollywood.

Of course it looks a bit suspicious, but it can be helpful if you machine generate tables etc..