code / tomo-coroutines

Lines715 C545 Assembly92 Tomo47 Markdown31

Tomo Coroutine Library

This is a coroutine library for Tomo built on top of a modified version of libaco.

Example Usage

1 use coroutines
3 func main()
4 co := Coroutine(func()
5 say("I'm in the coroutine!")
6 yield()
7 say("I'm back in the coroutine!")
8 )
9 >> co
10 say("I'm in the main func")
11 >> co.resume()
12 say("I'm back in the main func")
13 >> co.resume()
14 say("I'm back in the main func again")
15 >> co.resume()