lua-users home
lua-l archive

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


I found an issue with my code and debug.getinfo() which I reduced to the following testcase:

function g()
    for k,v in pairs(debug.getinfo(1,'n')) do print(k..'='..v) end
end

function f1()
    local r=g()
    return r
end

function f2()
    return g()
end

f1() -- prints namewhat=global name=g
f2() -- prints namewhat=

So, why in f2 the field 'name' is nil?

Cheers,
Federico Ferri