lua-users home
lua-l archive

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


>You could use metamethods to implement a read-only table, by implementing
>the 'index' metamethod.
>
>As far as i know it is not possible to restrict variable assignment, but I'm
>not sure if there are some special cases or some new aspects in Lua 5.

Global variables are stored in an ordinary Lua table.
See test/readonly.lua in the distribution.
--lhf