lua-users home
lua-l archive

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

Roberto Ierusalimschy wrote:
> * the API to weak tables is back to the beginning: no more
> setmode/getmode; it uses the field "__mode" in the metatable.

Good. This is more orthogonal. Meta-information belongs in meta-tables.

> * as we have anticipated, there are no more __gettable/__settable
> metaindices. They have been unified with __index/__newindex.

Great. Again, it's more orthogonal and smaller.

> * Threads are a new type in Lua. (That was necessary to solve the
> problem of garbage-collecting coroutines.) 

So, this is in essence a user-defined type like the "filehandle" type?
It's not another built-in type, I hope? 


> x = coroutine.create(function (a,b,c)
>       print(a,b,c)
>       print(coroutine.yield())
>       print(coroutine.yield())
>     end)
> coroutine.resume(x, 1, 2, 3)       --> 1, 2, 3
> coroutine.resume(x, 10)       --> 10
> coroutine.resume(x, 4, 5)          --> 4, 5
> print(coroutine.resume(x))   --> false   cannot resume dead coroutine

Could the coroutine be set up to work in an OO way like
the file handles? So we could say x:resume(1,2,3).    
Thank you for your hard work. 

"No one knows true heroes, for they speak not of their greatness." -- 
Daniel Remar.
Björn De Meyer