[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: modules and require all
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 13 Nov 2012 14:56:45 -0200
> A potential solution would be to introduce a new "global" or "unlocal"
> keyword, which would force the compiler to perform a global (_ENV) access,
> overriding the local scope of a variable.
>
>
> local a = 'local var'
> do
> local _ENV = require 'mod'
> global a
> print(a) --> from module
> end
What about this "solution"?
do
local mod = require 'mod'
print(mod.a) --> (no need for comment ;)
end
-- Roberto