[plt-scheme] PLT 371 Web-Server Generating Error "call-with-composable-continuation: cannot capture past continuation barrier"

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Oct 23 09:07:14 EDT 2007

Continuations have become more and less powerful. The API to the  
Control part of the system changed, and without seeing your code, I  
can't say anything more specific.

The define-macro system has always always brittle in my mind. You're  
much better off with define-syntax -- Matthias

On Oct 23, 2007, at 8:32 AM, Eric Domeshek wrote:

> Matthias,
> Thanks.  That did it.
> Still I'm curious about what changed to make the old call/cc  
> approach not work any more.  Likewise, what changed with define- 
> macro...
> --Eric
> Matthias Felleisen wrote:
>> Use let/ec for local function exists, e.g.,
>> (module foo mzscheme
>>   (require (lib "list.ss"))
>>   (define (f lx)
>>     (let/ec exit-from-f
>>       (foldr (lambda (x a) (if (= x 0) (exit-from-f 0) (* x a))) 1  
>> lx)))
>>   (printf "~s=0\n" (f '(1 2 3 0 4)))
>>   (printf "~s=24\n" (f '(1 2 3 4))))
>> -- Matthias
>> On Oct 22, 2007, at 8:27 PM, Eric Domeshek wrote:
>>> Noel,
>>> Thanks for the advice.  By dint of about 12 hours of hacking, I  
>>> got my stuff mostly ported to 371.  I got explicit about managing  
>>> session state in the move from unit-based to module-based  
>>> servlets.  I also ran into a problem with all my old "define- 
>>> macro" macros no longer working so I finally had to learn about  
>>> "define-syntax" macros and then rewrite all my macros.
>>> The good news is that the symptom that motivated this upgrade  
>>> seems to have been fixed by moving to 371.  The server no longer  
>>> hangs if I click a second time before getting the result of the  
>>> first click.
>>> The bad news is I've just spent another hour diagnosing a new  
>>> problem that's turned up: it seems that now I can't use call/cc  
>>> in my code.  I have an implementation of the Porter stemming  
>>> algorithm that uses call/cc to emulate CommonLisp's ability to do  
>>> non-local returns from a block or function.  When I invoke it  
>>> from inside my servlet I get the error message:  "call-with- 
>>> composable-continuation: cannot capture past continuation barrier"
>>> Any clue what this is about?  Or do you happen to have an  
>>> implementation of the Porter stemming algorithm hanging about  
>>> that doesn't use call/cc, or have a better way to do non-local  
>>> exits?
>>> Thanks again,
>>> --Eric

Posted on the users mailing list.