lua-users home
lua-l archive

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


How, or when, are local variables in a module actually defined and initialized?

Say we have

 module(mod)

 local some_bool = false
 local some_table = {}

 function some_function ()
 -- do stuff
 end

-- end module mod

which we use with

 require "mod"

 some_function()

...

=> Is this done by 'loader' in 'require' in listing 15.1 in PIL II (page 139), ie. are all (local) vars in the module 'mod' defined and initialized after 'require "mod"'?

Thanks for clarification.

With regards
- Stefan