Difference between revisions of "Coroutine (type)"
From ComputerCraft Wiki
m (moved Coroutine to Coroutine (type): Now we can link to this from Template:Type) |
(Remove old crud, simplify, and point back at the API page for more details, which now exist) |
||
Line 1: | Line 1: | ||
− | + | ''This is for the coroutine type, displayed as <code>thread</code> in the Lua language. For the API, visit [[Coroutine (API)]]. | |
− | '' | + | A ''coroutine'', or ''thread'', is an object which contains an execution context in a Lua program. A coroutine wraps up the location of the next statement to execute, the complete call stack of functions called to reach that statement, the local variables in those functions, and any other data needed to freeze, and subsequently thaw and resume, a running code sequence, as though nothing happened. |
− | + | For details on how coroutines are used, see the [[Coroutine (API)|coroutine API]]. | |
− | + | [[Category:Lua Types]] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | [[Category: | + |
Latest revision as of 18:24, 22 April 2013
This is for the coroutine type, displayed as thread
in the Lua language. For the API, visit Coroutine (API).
A coroutine, or thread, is an object which contains an execution context in a Lua program. A coroutine wraps up the location of the next statement to execute, the complete call stack of functions called to reach that statement, the local variables in those functions, and any other data needed to freeze, and subsequently thaw and resume, a running code sequence, as though nothing happened.
For details on how coroutines are used, see the coroutine API.