lua-users home
lua-l archive

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


>From lua-l@tecgraf.puc-rio.br  Thu Jul 13 17:59:35 2000
>From: Aaron Kamienski <aaronk@snaptwo.com>

>It would be nice if there were set/getlocal tag methods,

There are such tag methods because of performance.

>if locals could be accessed via an implicit local table (can they?).

Yes, via the debug API (or debug library in Lua).
See lua_getlocal/lua_setlocal and getlocal/setlocal.
But heed this warning in the manual:

 You should exert great care when using this library. The functions
 provided here should be used exclusively for debugging and similar
 tasks (e.g., profiling). Please resist the temptation to use them as a
 usual programming tool. They are slow and violate some (otherwise)
 secure aspects of the language (e.g., privacy of local variables).

--lhf