This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Coroutines with call/cc



>>>>> " " == Peder Chr Norgaard <pcn@tbit.dk> writes:

     > (Except that my need is not threads, but co-routines. Guile
     > have threads, working fine for many purposes, thank you, but
     > they are too heavyweight for this kind of work.  Shortly, I
     > want to "use call/cc to capture the part of the walking state
     > that is on the stack"; if I can't get that to work, my
     > alternative is not to use threads, but to capture the state
     > explicitly - which means that I need to recode a piece of fine
     > walking code to avoid use of recursion).

The explanation which brought me closest to understand call/cc is
Dorai Sitaram's "Teach Yourself Scheme in Fixnum Days"
  http://www.cs.rice.edu/~dorai/t-y-scheme/t-y-scheme.html
coroutines are among the examples presented there.

Are you sure that call/cc is less ``heavyweight'' than threads in
Guile?  I think Guile needs to copy the entire stack each time a
continuation is captured.
				best regards
					Roland