Created
September 17, 2016 21:36
-
-
Save katlogic/13909819cdd5284389a660b5b417e415 to your computer and use it in GitHub Desktop.
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
function lookup(t,p) | |
p:gsub("([^.]*).?", function(c) | |
if c == "" then return end | |
t = t[c] | |
end) | |
return t | |
end | |
print(lookup({a={b={c=1}}},"a.b.c")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment