lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>On a broader note, it might be interesting to factor the 
>debug interface into a "safe", fast reflection API and 
>a more intrusive, slower debug API.

It would be handy to have read-only access at least to some of the 
metadata [is that the right word?] available through the debug API without 
having to use, or even to expose, the entire API.

For example, string.dump() can only correctly be used on functions without 
upvalues, though it doesn't complain if you pass it a "closured" function.
However, the only way to check if a function has upvalues is via the debug 
API -- something you might want to disable in release builds of your code.

Being able to access the innards of the Lua VM (but not to change them) 
from production code would surely be useful, if only to allow more 
detailed "crash dumps" when exceptions happen than is otherwise possible 
if the debug library has been removed.