lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> local a = 'local var'
> do
>   local _ENV = require 'mod'
>   print(a)  --> local var
> end

Actually, this results in an error, unless mod defines mod.print...

Anyway, if you remove the outside declaration of a, then the code works
as intended:

local print=print
do
        local _ENV = require 'math'
        print(pi)
end