lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 18 October 2011 14:36, Norbert Kiesel <nkiesel@tbdnetworks.com> wrote:
> On Tue, 2011-10-18 at 10:58 -0700, Norbert Kiesel wrote:
>>  I saw other "strange" things in the code (e.g. ; as separator in
>> table initializations) which I now assume are also there deliberately.
>> Too bad...
>
> Hmm, sorry for that.  Just saw that this actually is valid Lua.  Good
> day - I learned something new (for me) about Lua...
>

Yes, I love this feature. Believe it or not it's one of my major
annoyances with Javascript that it only supports ',' and doesn't
ignore a trailing separator. I write tables in one of two ways - if on
a single line:

   { "one", "two", "three" }

For a longer list spanning multiple lines, or where I'm likely to
add/remove entries:

   {
       "one";
       "two";
       "three";
   }

Regards,
Matthew