lua-users home
lua-l archive

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


On 2015-07-05, at 4:23 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> Tuples are a special case of constant values. E.g.
> 
> const c = {1,2,3}
> 
> would create a constant table with three elements and associate it
> with the name c. The interpreter will remember that _ENV.c for this
> _ENV may not be redefined. A constant value can only be assigned
> to such constant table fields.

Could I call a function like table.append(c, 4)?

I had a more complicated proposal for "static" which might help. "static c = Const{1,2,3}" would do the same thing, even inside a loop.

Jay