Created
July 6, 2009 20:01
-
-
Save norman/141646 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local val = "hello world" | |
local env = getfenv() | |
local func = assert(loadstring("print(val)")) | |
setfenv(func, env) | |
print(func()) | |
-- expecting "hello world" but get "nil" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment