How to change the length operator ( # ) for a table in Lua, the manual suggests assigning the __len function in the metathe, and then assigning this metatetable table that I want to override, but that doesnβt mean t works as expected? I have no way to override this on C side.
turtles = {1,2,3} setmetatable(turtles, {__len = function(mytable) return 5 end}) print(
source share