[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.0 (work4) now available
- From: phlnc8 <phlnc8@...>
- Date: Sun, 1 Aug 2010 20:43:37 -0400
Daurn and Serguey, Thanks a lot for
local _ENV = setmetatable({},{__index=_G})
and (probably even better)
local _ENV = setmetatable({},{__index=_ENV})
It may be the easiest way to adapt existing modules.
One should also replace:
require 'my_module'
with
local my_module = require 'my_module'
If I understand correctly what Roberto said ("We are changing the
policy that modules should define globals."), it would be even more
useful to have some syntactic sugar for precisely this. Eg.:
import my_module
for
local my_module = require 'my_module'
I know this has already been proposed and discussed on the list, but
given this new module policy, wouldn't it make even more sense?
Phil