[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What is the name of the calling function?
- From: Dirk Laurie <dirk.laurie@...>
- Date: Tue, 7 May 2013 10:01:25 +0200
2013/5/7 Geoff Leyland <geoff_leyland@fastmail.fm>:
>> function a() print(debug.getinfo(2, "n").name) end
I can't believe I missed that, so I looked carefully at what I did.
Relative to your example, the minimal difference is this:
function a() print(debug.getinfo(2, "n").name) end
function b() return a() end
b()
nil
It is instructive to work out the reason why in this case there
is no name.
Thanks!