5

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?

Nathan Shively-Sanders
  • 18,329
  • 4
  • 46
  • 56
eonil
  • 83,476
  • 81
  • 317
  • 516
  • About which kind of "LISP" are you talking? – Svante Aug 09 '10 at 10:08
  • @Svante Mainly Scheme, but possibly any kind of LISP. I talked about LISP 'primitives' which any LISP has. I wanna challenge to make own implementation if I could :) – eonil Aug 10 '10 at 00:57
  • 3
    Ah. Well, I thought that you might mean some ancient dialect, one from the time where people still spelt it in all capitals. – Svante Aug 10 '10 at 02:08

1 Answers1

5

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
  • 26,737
  • 4
  • 62
  • 93