[plt-scheme] Writing stateless servlets: what is an "unsafe context"?

From: John Clements (clements at brinckerhoff.org)
Date: Thu Jan 21 12:34:16 EST 2010

I feel like I ought to be able to figure this out, but I'm getting an error message from serve/servlet that says:

../../../../../svn/clements/research/tdd-grant/first-applet/first-applet.ss:79:7: Servlet (@ /servlets/standalone.ss) exception:
Attempt to capture a continuation from within an unsafe context: (#((#t send/suspend) #f) #((#t (lambda (x2122))) #f) #((#f stx) #f) #((#t start) #f))

From the standpoint of the stateless compiler, what is an "unsafe context"? I searched the stateless server page for the phrase "unsafe context" without success.


Would it be bad if I did something like this, in order to capture the URL associated with the continuation?

(let ([url-cell (box #f)])
  (send/suspend (lambda (url) (set-box! url-cell url) (render-the-page url)))
  ...)
    

BTW, deploying servlets with the new language set is *very* smooth; no more taking ten minutes to set up a nice directory structure for the server to run in. Thanks!

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20100121/5a9cf761/attachment.p7s>

Posted on the users mailing list.