Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created May 26, 2011 20:50
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 hoelzro/994050 to your computer and use it in GitHub Desktop.
Save hoelzro/994050 to your computer and use it in GitHub Desktop.
local t = setmetatable({}, {__call = function(self, state, k)
return next(self, k)
end})
t.foo = 1
t.bar = 2
t.baz = 3
for k, v in t do
print(k, v)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment