[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to acquire the name of the variables passes to the self-defined C function which has been successfully set by lua_register()?
- From: Sean Conner <sean@...>
- Date: Thu, 21 Jan 2021 02:57:55 -0500
It was thus said that the Great Sudipto Mallick once stated:
> Lua tells us where the error occured: the file name and line number.
> How can the line itself be printed in the stack traceback? Why does
> not Lua do that already?
Because the "file" might not exist.
At work, I compile a Lua application, plus all the modules (both in C and
Lua) into a single executable. The modules written in Lua are compressed
(using zlib) and stored into the exectuable as blobs of data that the custom
loader knows how to uncompress and hand back to Lua. There is no "file" to
speak of, but it can still report useful information:
[string "org.conman.example"]:32: attempt to call a nil value (global 'print')
-spc