lua-users home
lua-l archive

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


You can set an environmetn for function dummy:

    function dummy()
        ...
    end

    setfenv(dummy, setmetatable({}, {__index =
getfenv(dummy)}))

This has to be done only once.  The environment is
private to dummy (no change in the globals) and is
static in the sense that it is preserved between
calls.

--
Wim


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com