Skip to content

Instantly share code, notes, and snippets.

@DamonHao
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save DamonHao/d5e8e69d4c17ef4e3db4 to your computer and use it in GitHub Desktop.

Select an option

Save DamonHao/d5e8e69d4c17ef4e3db4 to your computer and use it in GitHub Desktop.
note the difference between the loaded code(string) and the source code
local function main()
i = 32
local i = 0
f = load(" i = i + 1; print(i)")
g = function () i = i + 1; print(i) end
f()
g()
end
main()
-- output
-- 33
-- 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment