lua-users home
lua-l archive

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

Proxy tables and protected metatables are the "answer" to this, but they are
a relatively inconvenient answer. The support for userdata environments in
Lua 5.1 may make proxy tables a little more convenient but I don't know if
anyone has really pushed that issue through.

That being said, it would be nice to have some support for private keys that
would not be revealed by pairs. Doing so would make a number of
encapsulation issues simpler.


on 5/29/05 12:54 AM, Stukov at wrote:

> Hello all!
> My question is about privacy concepts. In Lua any table and field can
> be enumerated with foreach,foreachi,pairs,ipairs methods, no matter
> where they was declared - in C or in Lua. This is very inconvenience
> feature in Lua. I means that any person having access to script, at
> same time has acces to all declarations ( tables, functions and
> constants declared using only the C api). There is no way to create
> 'public' interface of my module or application. How to solve this
> problem?