From 25c5eac5e6ca1035db1eddd7bea9ac78531da57e Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 28 Dec 2023 11:23:49 -0500 Subject: Delete manuals! Good riddance! These are hosted on files.dthompson.us now! --- manuals/sly/Coroutines.html | 134 -------------------------------------------- 1 file changed, 134 deletions(-) delete mode 100644 manuals/sly/Coroutines.html (limited to 'manuals/sly/Coroutines.html') diff --git a/manuals/sly/Coroutines.html b/manuals/sly/Coroutines.html deleted file mode 100644 index 26e5c73..0000000 --- a/manuals/sly/Coroutines.html +++ /dev/null @@ -1,134 +0,0 @@ - - - - - -Sly: Coroutines - - - - - - - - - - - - - - - - - - - - -
-

-Next: , Previous: , Up: Time   [Contents][Index]

-
-
- -

4.3.2 Coroutines

- -
-
(use-modules (sly coroutine))
-
- -

Coroutines are the building block for cooperative multitasking. When -used with agendas, they are a powerful mechanism for writing -algorithms that span multiple clock ticks in a straightforward, linear -fashion. Sly’s coroutines are built on top of Guile’s delimited -continuations, called prompts. -

-

To run a procedure as a coroutine, use the call-with-coroutine -procedure. Once inside the coroutine prompt, the yield -procedure can be used to pause the procedure and pass its continuation -to a callback procedure. The callback may call the continuation at -its convenience, resuming the original procedure. -

-

Coroutines are particularly useful in conjunction with Agendas. -

-
-
Scheme Procedure: call-with-coroutine thunk
-

Apply thunk within a coroutine prompt. -

- -
-
Scheme Syntax: coroutine body
-

Evaluate body within a coroutine prompt. -

- -
-
Scheme Syntax: colambda args body
-

Syntacic sugar for a lambda expression whose body is run -within a coroutine prompt. -

- -
-
Scheme Syntax: codefine (name formals …) body
-

Syntacic sugar for defining a procedure called name with formal -arguments formals whose body is run within a coroutine -prompt. -

- -
-
Scheme Syntax: codefine* (name formals …) body
-

Syntacic sugar for defining a procedure called name with -optional and keyword arguments formals whose body is run -within a coroutine prompt. -

- -
-
Scheme Procedure: yield callback
-

Yield continuation to the procedure callback. -

- - - - - - -- cgit v1.2.3