… | |
… | |
185 | |
185 | |
186 | Create a new asynchronous coroutine and return it's coroutine object |
186 | Create a new asynchronous coroutine and return it's coroutine object |
187 | (usually unused). When the sub returns the new coroutine is automatically |
187 | (usually unused). When the sub returns the new coroutine is automatically |
188 | terminated. |
188 | terminated. |
189 | |
189 | |
190 | Calling C<exit> in a coroutine will try to do the same as calling exit |
190 | Calling C<exit> in a coroutine will do the same as calling exit outside |
191 | outside the coroutine, but this is experimental. It is best not to rely on |
191 | the coroutine. Likewise, when the coroutine dies, the program will exit, |
192 | exit doing any cleanups or even not crashing. |
192 | just as it would in the main program. |
193 | |
|
|
194 | When the coroutine dies, the program will exit, just as in the main |
|
|
195 | program. |
|
|
196 | |
193 | |
197 | # create a new coroutine that just prints its arguments |
194 | # create a new coroutine that just prints its arguments |
198 | async { |
195 | async { |
199 | print "@_\n"; |
196 | print "@_\n"; |
200 | } 1,2,3,4; |
197 | } 1,2,3,4; |