lua-users home
lua-l archive

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


On Oct 20, 2011, at 5:03 AM, Ben Kelly wrote:

> Yeah, I can use debug.setupvalue(), but now I'm using the debug library
> in release code, which last I checked was considered extremely
> inappropriate under any circumstances.

Contrast:

The Debug Library - circa 5.1

This library provides the functionality of the debug interface to Lua programs. You should exert care when using this library. The functions provided here should be used exclusively for debugging and similar tasks, such as profiling. Please resist the temptation to use them as a usual programming tool: they can be very slow. Moreover, several of these functions violate some assumptions about Lua code (e.g., that variables local to a function cannot be accessed from outside or that userdata metatables cannot be changed by Lua code) and therefore can compromise otherwise secure code.

http://www.lua.org/manual/5.1/manual.html#5.9


The Debug Library - circa 5.2

This library provides the functionality of the debug interface to Lua programs. You should exert care when using this library. Several of these functions violate basic assumptions about Lua code (e.g., that variables local to a function cannot be accessed from outside; that userdata metatables cannot be changed by Lua code; that Lua programs do not crash) and therefore can compromise otherwise secure code. Moreover, some functions in this library may be slow.

http://www.lua.org/work/doc/manual.html#6.10

Feel free to go wild! But only in 5.2 :P