lua-users home
lua-l archive

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

On Tuesday 15 February 2005 5:49 am, Mike Pall wrote:
> In short, you can now:
> - Yield across all metamethods (except __gc).
> - Yield across iterator functions (for x in func).
> - Yield across callbacks (table.foreach(), dofile(), ...).
> - Yield across protected callbacks (pcall(), xpcall(), ...).
> - Yield from C functions and resume back to them.

this scares me a bit...  i was aware of the last problem (yielding across C 
functions), but none of the others.  the first two are specially worrysome

- for metamethods you mean any function in a metatable? or just the hooks?  on 
second thought, the methods used for OO-like constructs aren't in the 
metatable, but in another table referenced by the __index hook; so i guess 
we're safe here.

- for "across iterator functions", do you mean "from an iterator"? or from 
inside a for loop?  i use coroutine iterators, are those safe?


Attachment: pgpAdX9weOgrB.pgp
Description: PGP signature