lua-users home
lua-l archive

indexing of new created tables

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


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.

AltStyle によって変換されたページ (->オリジナル) /