[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1.1 has been frozen
- From: Javier Guerra <javier@...>
- Date: Tue, 13 Jun 2006 10:32:32 -0500
On Tuesday 13 June 2006 10:23 am, Andreas Stenius wrote:
> class MyTest
> {
> class.public
> {
> foo = function( ... ) end;
> bar = function() end;
> };
>
> class.private
> {
> bonk = 5;
>
> -- my last note for tbl constr.
> -- ouch, should work for keyword 'function' too..
> function phobo( ... ) end;
> }
> }
you can use the same trick as module() does:
local MyTest = { pub = {}, priv = {} }
local prevG = getfenv ()
setfenv (MyTest.pub)
function foo (....) .... end
function bar (....) .... end
setfenv (MyTest.priv)
bonk = 5;
function phobo (...) .... end
setfenv (prevG)
--
Javier
Attachment:
pgpPQsyqvWrcN.pgp
Description: PGP signature