lua-users home
lua-l archive

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


On Mon, Apr 2, 2012 at 9:06 AM, Jerome Vuarand <jerome.vuarand@gmail.com> wrote:
> How did you do it? Because the following doesn't run in 5.1 if in the same file:
> (...) snip (...)
> lua: test15.lua:13: attempt to call global 'module' (a nil value)
>
> So either you need some boilerplate, or you constrain the way you write modules.
>

I believe what's happening is that since first module call clears the
global namespace, the interpreter can't find any reference of the
global module function at the second call. So one should do

" local module = module "

before the first module call.



-- 
NI!