Re: Why Lua allow an extra comma after the last element of a table?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Why Lua allow an extra comma after the last element of a table?
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: 2013年3月11日 07:42:58 +0000
2013年3月10日 William Ahern <william@25thandclement.com>:
> for (;;) {
> again:(void)0; // valid void expression which documents intent
> }
>
> Note that the `for (;;)' is also using null statements. The void expression
> pattern in the last example assures the reader that you didn't accidentally
> omit a statement, which outside of for loop expressions is probably the
> first conern that comes to mind when you spot a lone semicolon.
>
> Lua has null statements, though not void expressions:
IMHO short comments better document the absence of an expression than
a void expression. And Lua has comments.
C: for (;;) /* no-op */;
Lua: repeat --[[ no-op ]] until the_end_of_time