lua-users home
lua-l archive

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


Hallo,

On 3/15/07, Graham Wakefield <lists@grahamwakefield.net> wrote:
Oh and an obvious extension would be:

function makeMethod(obj, func)
        -- local f = copy func     -- how can I do this in Lua?
          local f = loadstring(string.dump(func))
        setfenv(f, obj)
        return f
end


Cheers,
--
-alex
http://www.ventonegro.org/