[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: debug.getinfo(..).name is set/nil depending on subtle differences
- From: Francisco Olarte <folarte@...>
- Date: Wed, 16 Dec 2020 12:27:43 +0100
Federico:
On Wed, Dec 16, 2020 at 12:00 PM Federico Ferri
<federico.ferri.it@gmail.com> wrote:
> I found an issue with my code and debug.getinfo() which I reduced to the following testcase:
....
> So, why in f2 the field 'name' is nil?
Mandatory tail call elimination? I get this, have not dug more as I'm
not too familiar with the expected returns:
Lua 5.3.3 Copyright (C) 1994-2016 Lua.org, PUC-Rio
> 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()
name=g
namewhat=global
nil
> f2()
namewhat=
> g()
namewhat=
Francisco Olarte.