summaryrefslogtreecommitdiff
path: root/doc/scripting/coroutine.texi
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-09-24 21:06:41 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-09-24 21:06:41 -0400
commit1f1deea662da4328bf588c0642c8a90c7b1f2144 (patch)
treea7973b46b580ca2a9e8fb65f459e0004ae87b64f /doc/scripting/coroutine.texi
parent7937b85219607a6e7755907e0752343344ed036c (diff)
Rough draft of manual.
Diffstat (limited to 'doc/scripting/coroutine.texi')
-rw-r--r--doc/scripting/coroutine.texi38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/scripting/coroutine.texi b/doc/scripting/coroutine.texi
new file mode 100644
index 0000000..75723da
--- /dev/null
+++ b/doc/scripting/coroutine.texi
@@ -0,0 +1,38 @@
+@node Coroutines
+@section Coroutines
+
+Coroutines are the building block for cooperative multitasking. When
+used with agendas, they are a powerful mechanism for writing game
+scripts.
+
+@anchor{2d coroutine coroutine}@defun coroutine thunk
+Calls a procedure that can yield a continuation.
+
+@end defun
+
+@anchor{2d coroutine colambda}@defspec colambda args body ...
+Syntacic sugar for a lambda that is run as a coroutine.
+
+@end defspec
+
+@anchor{2d coroutine codefine}@defspec codefine (name ...) . body
+Syntactic sugar for defining a procedure that is run as a coroutine.
+
+@end defspec
+
+@anchor{2d coroutine codefine*}@defspec codefine* (name ...) . body
+Syntactic sugar for defining a procedure with optional and keyword
+arguments that is run as a coroutine.
+
+@end defspec
+
+@anchor{2d coroutine wait}@defun wait [delay]
+Yield coroutine and schdule the continuation to be run after DELAY
+ticks.
+
+@end defun
+
+@anchor{2d coroutine yield}@defun yield callback
+Yield continuation to a CALLBACK procedure.
+
+@end defun