Difference between revisions of "Coroutine.wrap"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | '''Available since:''' Gideros 2011.6<br/> | + | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> |
− | === Description === | + | === <translate>Description</translate> === |
<translate>Creates a new coroutine, with body f. f must be a Lua function. Returns a function that resumes the coroutine each time it is called. Any arguments passed to the function behave as the extra arguments to resume. Returns the same values returned by resume, except the first boolean. In case of error, propagates the error.</translate> | <translate>Creates a new coroutine, with body f. f must be a Lua function. Returns a function that resumes the coroutine each time it is called. Any arguments passed to the function behave as the extra arguments to resume. Returns the same values returned by resume, except the first boolean. In case of error, propagates the error.</translate> | ||
<source lang="lua"> | <source lang="lua"> | ||
(function) = coroutine.wrap(f) | (function) = coroutine.wrap(f) | ||
</source> | </source> | ||
− | === Parameters === | + | === <translate>Parameters</translate> === |
'''f''': (function) <translate>lua function</translate> <br/> | '''f''': (function) <translate>lua function</translate> <br/> | ||
− | === Return values === | + | === <translate>Return values</translate> === |
− | '''Returns''' (function) <translate>function that resumes coroutine every time it is called, behaving similar to coroutine.resume</translate><br/> | + | '''<translate>Returns</translate>''' (function) <translate>function that resumes coroutine every time it is called, behaving similar to coroutine.resume</translate><br/> |
Revision as of 07:28, 24 August 2018
Available since: Gideros 2011.6
Description
Creates a new coroutine, with body f. f must be a Lua function. Returns a function that resumes the coroutine each time it is called. Any arguments passed to the function behave as the extra arguments to resume. Returns the same values returned by resume, except the first boolean. In case of error, propagates the error.
(function) = coroutine.wrap(f)
Parameters
f: (function) lua function
Return values
Returns (function) function that resumes coroutine every time it is called, behaving similar to coroutine.resume