Page 1 of 1

Unexpected non-error in table

Posted: Sat Nov 20, 2021 9:16 pm
by p-OS

Code: Select all

numeri={
 uno=1,
 due=2,
 tre=3,
}
After the last Item in the table there is a comma, without any item following.

I wonder, why this does not result in an error message ?

Re: Unexpected non-error in table

Posted: Sat Nov 20, 2021 10:14 pm
by plouf
because hollywood is designed with simplicity in mind instead of "c style hardcode" ?

i believe the opposite should be an error, which does (not add a comma)
but "reserving a seat" without using , why should be an error ?

Re: Unexpected non-error in table

Posted: Sun Nov 21, 2021 2:21 pm
by airsoftsoftwair
That's indeed a feature and not a bug. Many programming languages behave like that, e.g. in C you can do the same and of course also in Lua.