[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: incompatibilities to 5.0 beta
- From: Björn De Meyer <bjorn.demeyer@...>
- Date: Tue, 19 Nov 2002 18:33:47 +0100
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)
> 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." --
Björn De Meyer