lua-users home
lua-l archive

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

I'm wondering is it possible to create a value that has the
apparent type modifier "const". i.e., something you can't
modify at all.

The only way I can think of to pull something like this off
is the create the variable I want to be read-only as a
userdata with some magic "const" tag value and then use some
tag methods to block attempts to actually set it. I'm not
sure if this would work or not though.

Is this the only way, or is there maybe a better way?