lua-users home
lua-l archive

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


On May 8, 2018 8:11:26 AM UTC, Dirk Laurie <dirk.laurie@gmail.com> wrote:
>When the right-hand side of an assignment is an anonymous function, 
>I
>nowadays put a semicolon after the final "end" to distinguish it 
>from
>other uses of  'end'. Do you like the idea or hate it?

I've done so for many years, but in my case it's for consistency: I terminate all assignment statements [1] with semicolons; an anonymous function is no different than any other expression to me (first class value).

Similarly, since "local function foo() end" is syntactic sugar for an assignment statement, I also terminate that with a semicolon.

[1] as well as standalone function-call statements.

-- David