lua-users home
lua-l archive

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


The # symbol is an operator, while [....] is not. While I'm not sure why () is required, it's important to observe that *all* operators don't need ().


On Sun, Jul 23, 2017, 08:17 <[email protected]> wrote:
Why a new table needs to be put in parentheses to index it?
a =  {4, 3, 2, 1} [2]   --error
a = ({4, 3, 2, 1})[2]   --ok
at the same time length operator # works either way.


--
--
Ryan <[email protected]>
Software Developer / System Administrator
https://hashbang.sh