lua-users home
lua-l archive

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


On 4/24/06, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> > The trouble I have is the fact that the module function adds the module
> > name to the global table.
>
> How about redefining 'module'? Something like this (untested):
>
> do
>         local _module=module
>         module=function(name,...)
>                 local v=_G[name]
>                 _module(name,...)
>                 _G[name]=v
>         end
> end

I think in that case, _module would change the environment of your
temporary function, not the function that is calling your wrapper.

Greg F