lua-users home
lua-l archive

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


> What if the object wants to protect the metatable from public access, like this?

It still works for me. 

   require"bc"
   bc.digits(20)
   x=bc.sqrt(2)

   print(getmetatable(x))
   print(x)
   print(x:tostring())
   print(x:__tostring())

   getmetatable(x).__metatable=false
   print(getmetatable(x))
   print(x)
   print(x:tostring())
   print(x:__tostring())