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 <temp212@gorodok.net> 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 <vandor2012@gmail.com>
Software Developer / System Administrator
https://hashbang.sh