Last active
August 29, 2015 14:11
-
-
Save DamonHao/d5e8e69d4c17ef4e3db4 to your computer and use it in GitHub Desktop.
note the difference between the loaded code(string) and the source code
This file contains hidden or 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 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