Created
August 15, 2012 21:06
-
-
Save coolaj86/3363690 to your computer and use it in GitHub Desktop.
Weird Scope in Luvit / Lua
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 msg = "hello" | |
local coolness = function () | |
local foo = "bar" | |
print(msg) | |
print(foo) | |
return foo | |
end | |
local function daAwesome() | |
local baz = coolness() | |
print(foo) | |
end | |
doAwesome() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment