Advertisement
theoriginalbit

Indexing table via invoking table

Oct 16th, 2013
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.14 KB | None | 0 0
  1. local tArgs = setmetatable({"hello", "world"}, {
  2.   __call = function(t, i)
  3.     return t[i]
  4.   end
  5. })
  6.  
  7. print(tArgs[1])
  8. print(tArgs(1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement