From: Eric Domeshek (domeshek at stottlerhenke.com) Date: Tue Oct 23 08:32:49 EDT 2007 |
|
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