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] |
Most likely I'm confused because I haven't really studying the messages, but some of the claims I've seem incorrect: > You can't pass the current continuation > into scopeWalkDemo as a parameter, since the binding would be > captured. Maybe passing it in a variable would be helpful: Note that call/cc makes a copy of the *control stack*. It does *not* copy the value stack. The saved continuation does "capture" the variable bindings, but it does not save, restore or do anything to the *values* of bindings. So something like this should work: (let ((saved-continuation ...) (suspend (lambda (value) ;; swap current continuation and saved-continuation (call/cc (lambda (k) (let ((ksaved saved-continuation)) (set! saved-continuation k) (ksaved value)))))) (routine1 (lambda () ... (suspend x) ...)) (routine2 (lambda () ... (suspend y) ...))) (routine1)) Admittedly, this glosses over some of the difficult parts, such as how saved-continuation is initialized (to run routine2). What am I missing? --Per Bothner Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner