From e476799ab7d0e26256ac9be25888e963dc0928a0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 2 May 2025 22:50:18 -0400 Subject: Move coroutines into examples folder due to compatibility issues on some platforms/compilers --- examples/coroutines/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 examples/coroutines/README.md (limited to 'examples/coroutines/README.md') diff --git a/examples/coroutines/README.md b/examples/coroutines/README.md new file mode 100644 index 00000000..eef923e0 --- /dev/null +++ b/examples/coroutines/README.md @@ -0,0 +1,24 @@ +# Tomo Coroutine Library + +This is a coroutine library built on top of a modified version of +[libaco](https://libaco.org). + +## Example Usage + +```tomo +use coroutines + +func main() + co := Coroutine(func() + say("I'm in the coroutine!") + yield() + say("I'm back in the coroutine!") + ) + >> co + say("I'm in the main func") + >> co.resume() + say("I'm back in the main func") + >> co.resume() + say("I'm back in the main func again") + >> co.resume() +``` -- cgit v1.2.3