2

Is there a way to get a tables metatable? e.g.

local tbl = {}
setmetatable(tbl, {__call = function() print("tbl called") end})

-- how to get metatable of tbl?
Birk
  • 191
  • 2
  • 12

1 Answers1

4

You can use getmetatable(tbl) to get the assigned metatable (or nil if none is assigned).

Paul Kulchenko
  • 25,884
  • 3
  • 38
  • 56