[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: Privacy
- From: Stukov <Stukov@...>
- Date: Mon, 30 May 2005 11:23:03 +0400
Hello Edwin,
EEM> Mayber you can check out Programming in Lua
EEM> and read the part on object orientation:
EEM> http://www.lua.org/pil/16.html
It's a case if class privacy.
I need 'interface' privacy.
Example:
somecode.c ----------
lua_State* L;
static const luaL_reg banklib[] = {
{"CurrenAccount", curAcc},
{"CurrentPassword", curPwd},
{"GetAdminPassword", adminPwd},
{NULL, NULL}
};
luaL_openlib(L, "bank", banklib, 0);
----------------
script.lua ------------
for line in pairs(bank) do
print(line)
end
------------
output:
CurrenAccount
CurrentPassword
GetAdminPassword
But I want to hide 'GetAdminPassword' from ENUMERATING.
Of course, if user knows that 'bank' table has method 'GetAdminPassword', he
can call it.
--
Best regards,
Stukov
mailto:Stukov@gala.net