lua-users home
lua-l archive

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


I'd like to have a meta function, sth. like

        function fn_matrix(fn_name, arg_foo)
                string2var(fn_name) = function(arg_foo) print(fn_name, arg_foo) end
        end

Every time fn_matrix is called, it creates a function of the name fn_name that takes
arg_foo as the first parameter and prints out the function's own name and
arg_foo.

Thanks.
Wei