[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 1 Aug 2010 16:16:35 -0300
> > Yes. We are changing the policy that modules should define globals. We
> > changed environments. We think now the 'module' function adds too much
> > complication for something that it is easy to do directly.
>
> How would you do it directly? Something like this?
>
> local _M = []
> in _M do
> function globalfunction()
> -- ...
> end
> end
> return _M
Probably something like this:
local _ENV={}
function f1() ... end
function f2() ... end
...
return _ENV