views:

121

answers:

1

First, I'm a LISP newbie.

What I want to get is a cooperative micro-threading feature. And this can be gained with coroutine. As I know, Scheme supports coroutines via continuations. However, not all Scheme implementation may have continuations. If so, can I add a continuation feature with only LISP primitives?

+4  A: 

You can. Chapters 5 and 6 of Essentials of Programming Languages shows how to implement continuations in Scheme. In his book On Lisp, Paul Graham explains how to implement continuations in Common Lisp (Chapters 20-22).

Vijay Mathew
These 'continuations' for CL are relatively limited, I'd think.
Rainer Joswig
@Rainer Can I know about the limitation?
Eonil
@Eonil On Lisp contains an implementation of multi-threading on continuations, so co-routines also might be possible with that implementation.
Vijay Mathew
@Vijay Yes, thanks again!
Eonil