Coroutine.wrap: Difference between revisions

From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Creates a new coroutine, with body f. f must be a Lua function. Returns a function that resumes the co..."
 
No edit summary
Line 4: Line 4:
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.
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.
<source lang="lua">
<source lang="lua">
(function), = coroutine.wrap(f,)
(function) = coroutine.wrap(f)
</source>
</source>
'''f:''' (function) lua function ''''''<br/>
'''f''': (function) lua function ''''''<br/>
'''Returns''' (function) function that resumes coroutine every time it is called, behaving similar to coroutine.resume<br/>
'''Returns''' (function) function that resumes coroutine every time it is called, behaving similar to coroutine.resume<br/>

Revision as of 09:20, 23 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)

'f: (function) lua function '
Returns (function) function that resumes coroutine every time it is called, behaving similar to coroutine.resume