Advertisement
Guest User

Lua Exercise

a guest
Jun 28th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. local function f(_ENV, _G, table)
  2.    -- how to access global "table" from here?
  3. end
  4.  
  5. local env_without_G = setmetatable({}, {
  6.    __index =
  7.       function (tbl, key)
  8.          if key ~= "_G" and key ~= "table" then
  9.             return _ENV[key]
  10.          end
  11.       end
  12. })
  13.  
  14. f(env_without_G, nil, nil)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement