lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Doing an experiment on chaining metatables I came up with this test code:

http://pastie.org/3551948

the pattern is:

  Obj1 = { test = function() print("ok") end }
  Obj2 = {}
  setmetatable(Obj2, { __index = Obj1 })
  Obj3 = {}
  setmetatable(Obj3, { __index = Obj2 })
  Obj3.test()

etc...

Interestingly, both lua and luajit halt when the number of
"indirections" is > 99, and I was wondering why.

-- 
--------------------------------------------------------------
EmmanuelOga.com - Software Developer