[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: Florian Weimer <fw@...>
- Date: Sun, 01 Aug 2010 21:02:03 +0200
* Roberto Ierusalimschy:
> 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
Conceptually, in/do/end could be an expression returning the table,
leading to "return in {} do --[ ... ] end".
I'm a bit worried about lack of a common idiom for setting up modules.
Perhaps the module loader should take care of such details?