Lua 5.1 or 5.2?
View Single Post
06-06-12, 12:00 PM
A Molten Giant
Join Date: Jul 2006
To mention what would be most impacted would be the SecureHandler system as it relies entirely on being able to create independent secure environments.
8.1 – Changes in the Language
The concept of environment changed. Only Lua functions have environments. To set the environment of a Lua function, use the variable _ENV or the function load.
C functions no longer have environments. Use an upvalue with a shared table if you need to keep shared state among several C functions. (You may use luaL_setfuncs to open a C library with all functions sharing a common upvalue.)
To manipulate the "environment" of a userdata (which is now called user value), use the new functions lua_getuservalue and lua_setuservalue.
8.2 – Changes in the Libraries
Functions setfenv and getfenv were removed, because of the changes in environments.
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
Last edited by SDPhantom : 06-06-12 at
View Public Profile
Send a private message to SDPhantom
Visit SDPhantom's homepage!
Find More Posts by SDPhantom