[racket-dev] Web continuations interaction with BSL

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Sep 6 12:36:34 EDT 2010

Short: I've just pushed a fix.

Long: The student languages disallow reading "dotted" pairs like '(1 .
2) which the Web server uses when encoding continuation identifiers
into URLs. This restriction is in effect for the dynamic extent of the
evaluation of a student program. The fix is to explicitly ensure that
this option is on in the continuation URL decoder.

Jay

2010/9/4 Nadeem Abdul Hamid <nadeem at acm.org>:
> OK, next puzzle:
> Here's a simple web servlet that displays two linked pages:
>
> ;; serveit.rkt
> #lang racket
> (require web-server/servlet
>         web-server/servlet-env)
> ; serve-it : string string -> void
> (define (serve-it text1 text2)
>  (serve/servlet
>   (λ(req)
>     (send/suspend/dispatch
>      (λ(make-url)
>        (letrec ([page1 (λ(req) `(html (p ,text1)
>                                       (p (a ([href ,(make-url
> page2)]) "Page2"))))]
>                 [page2 (λ(req) `(html (p ,text2)
>                                       (p (a ([href ,(make-url
> page1)]) "Page1"))))])
>          (page1 req)))))))
> (provide serve-it)
>
>
> This runs fine on its own.
>
> Now, trying to use this from a BSL program,
>   (require "serveit.rkt")
>   (serve-it "This is the first page" "This is the second page")
>
> will render the first page fine, but the link doesn't work. It seems
> like the continuations are being generated, but are then not
> accessible somehow?
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93


Posted on the dev mailing list.