On Sun, May 13, 2012 at 10:10 PM, Fjölnir Ásgeirsson <fjolnir@xxxxxxxxxxxxx>wrote: > Not if the function is inlined. > > I don't mean to call the original function - I want to rewrite the body in lua, not sure I made that clear. I wondered if I can, instead of returning the ffi.load, return an object with a metatable that implements lua functions and for all else falls through with an __index function. But so far I am not successful. Seems I am trying to do something that is beyond my somewhat limited lua skills. Not a good place to be if you want to mess with ffi.