Philippe Lorin <firstname.lastname@example.org> wrote:
| Pascal Costanza wrote:
| > What do you actually want to express?
| It's a kind of cooperative multitasking.
| I need three things: CSTART, CSTEP and YIELD.
CMUCL's "multiprocessing" (green threads, really) can easily do this
[given some trivial wrappers], as can SBCL and several other Common
Lisps with threads. In the case of CMUCL, I think this [untested]
does approximately what you asked for:
(defmacro cstart (&body body)
`(mp:make-process (lambda () (yield) ,@body)))
(defun cstep (c)
(defun yield ()
Rob Warnock <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607