Skip to content

Instantly share code, notes, and snippets.

@PilzAdam
Created May 6, 2013 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PilzAdam/5528813 to your computer and use it in GitHub Desktop.
Save PilzAdam/5528813 to your computer and use it in GitHub Desktop.
function check(var, arg)
local ret = var
local i=1
while i <= #arg do
ret = ret[arg[i]]
if not ret then
return false
end
i = i+1
end
return ret
end
print( check({x={y=2}}, {"x", "y"}) ) --> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment