lua-users home
lua-l archive

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


2015-06-23 18:06 GMT+02:00 Soni L. <fakedme@gmail.com>:
> co = coroutine.create(function() print"test" end)
> ...
> Can we get a thread metatable?

Yes.

debug.setmetatable(co,{__len=function(thread) return "abc" end})
print(#co) --> abc