lua-users home
lua-l archive

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


On Mar 5, 2012, at 6:07 AM, Christopher Berardi wrote:

> On Sun, Mar 04, 2012 at 10:45:43AM -0800, Mark Hamburg wrote:
>> P.S. One thing I love about Lua over JavaScript is that Lua's grammar
>> actually makes semicolons optional as opposed to JavaScript which tries
>> to patch things up after the fact with rules for semicolon insertion.
> 
> In addition, the ability to add a trailing comma makes adding new items
> to the list and rearranging the order of the list items less of a hassle
> in Lua than in JavaScript.

I got screwed by expecting JavaScript to do the right thing. In C, it makes perfect sense to imply a trailing NULL entry. In languages that carry length with arrays, no.