I&#39;m trying to write a servlet that plugs into the existing server. Here&#39;s an example:<div><br></div><div><div>#lang racket</div><div>(require web-server/servlet-env)</div><div>(require web-server/http/bindings)</div>
<div>(require web-server/http/response-structs)</div><div>(require web-server/http/xexpr)</div><div><br></div><div>(require racket/sandbox)</div><div>(define lazy-eval (make-evaluator &#39;lazy))</div><div><br></div><div>
(map lazy-eval</div><div>     &#39;(</div><div>       (require web-server/http/bindings)</div><div>       (require web-server/http/response-structs)</div><div>       (require web-server/http/xexpr)</div><div>       (require racket/promise)</div>
<div>       (define (lazy-handler request)</div><div>         (let ((bindings (request-bindings request)))</div><div>           (if (exists-binding? &#39;hi bindings)</div><div>               (response/xexpr &quot;Hi!&quot;)</div>
<div>               &quot;&quot;)))</div><div>       ))</div><div><br></div><div>(define (start request)</div><div>  (force ((lazy-eval &#39;lazy-handler)</div><div>          request)))</div><div><br></div><div>(serve/servlet start</div>
<div>               #:launch-browser? #f</div><div>               #:quit? #f</div><div>               #:listen-ip #f</div><div>               #:servlet-path &quot;&quot;</div><div>               #:port 8080</div><div>               #:servlet-regexp #rx&quot;main.*&quot;</div>
<div>               #:extra-files-paths</div><div>               (list (build-path (current-directory) &quot;extraFiles&quot;)))</div><br><div class="gmail_quote">On Wed, Mar 21, 2012 at 6:22 AM, Matthias Felleisen <span dir="ltr">&lt;<a href="mailto:matthias@ccs.neu.edu">matthias@ccs.neu.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On Mar 21, 2012, at 5:18 AM, Nathan Breit wrote:<br>
<br>
&gt; Hi,<br>
&gt; I&#39;m trying to implement a Racket web-server handler that does lazy evaluation. My approach so far as been to try making a evaluator/namespace that uses the lazy racket, then evaluate a function in it that returns a lazy request handler. However, I&#39;m running into problems getting the handler to read the request object. My last resort will be to make a request serializer and pass serialized requests into the handler, but is there a better way?<br>

&gt; Thanks,<br>
&gt; -Nathan<br>
</div></div>&gt; ____________________<br>
&gt;  Racket Users list:<br>
&gt;  <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br>
<br>
<br>
Are you trying to write a web server in Lazy or are you trying to write a servlet in Lazy and plug it into the existing strict server? Perhaps you want to post a code snippet that shows where things fail. -- Matthias<br>

<br>
</blockquote></div><br></div>