Re: Monitoring function calls from C in 5.1
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Monitoring function calls from C in 5.1
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2022年8月22日 08:12:41 -0300
> Or is there a function in Lua I could “wrap” for this kind of tracing?
function WRAP(f)
return function (...)
print("WRAP in ",...)
local t=table.pack(f(...))
print("WRAP out",table.unpack(t))
return table.unpack(t)
end
end
function f(x,y,z)
return x+y+z,x*y*z
end
f=WRAP(f)
f(10,20,30)