<div dir="ltr"><div style>It seems like pages are built and saved to a table which looks like</div><div><br></div><div><div>'#hasheq((#<procedure:static-page></div><div> .</div><div> (html</div>
<div> (head (title "My CV"))</div><div> (body (p (a ((href "index.html")) "Dave Herman")))))</div><div> (#<procedure:static-page></div><div> .</div>
<div> (html</div><div> (head (title "My Web Site"))</div><div> (body (p "Check out my " (a ((href "cv.html")) "CV."))))))</div></div><div><br></div><div style>
Then the values of the above are written out.</div><div style><br></div><div style>Except in the code seems to "normalize" (html ...) and do a conditional to see full? vs incremental?.</div><div style><br></div>
<div style><div><pre style="color:rgb(165,42,42)">(<span class="" style="color:rgb(68,0,203);font-weight:bold">define</span> (<span class="" style="color:black">write-page</span> <span class="" style="color:black">site</span> <span class="" style="color:black">page</span> [<span class="" style="color:black">out</span> (<span class="" style="color:navy">current-output-port</span>)])
(<span class="" style="color:rgb(68,0,203);font-weight:bold">let</span> ([<span class="" style="color:black">data</span> (<span class="" style="color:black">normalize-response</span> <span class="" style="color:green">#t</span> (<span class="" style="color:black">hash-ref</span> (<span class="" style="color:black">site-table</span> <span class="" style="color:black">site</span>) <span class="" style="color:black">page</span>))])
(<span class="" style="color:rgb(68,0,203);font-weight:bold">cond</span>
[(<span class="" style="color:black">response/full?</span> <span class="" style="color:black">data</span>)
(<span class="" style="color:black">for</span> ([<span class="" style="color:navy">bytes</span> (<span class="" style="color:black">response/full-body</span> <span class="" style="color:black">data</span>)])
(<span class="" style="color:navy">write-bytes</span> <span class="" style="color:navy">bytes</span> <span class="" style="color:black">out</span>))]
[(<span class="" style="color:black">response/incremental?</span> <span class="" style="color:black">data</span>)
(<span class="" style="color:navy">error</span> <span class="" style="color:rgb(68,0,203);font-weight:bold">'</span><span class="" style="color:black">write-page</span> <span class="" style="color:green">"incremental responses unsupported"</span>)])))</pre>
</div><div style>I changed to </div><div style><br></div><div style><div>(define (write-page site page [out (current-output-port)])</div><div> (let ([data (hash-ref (site-table site) page)])</div><div> (cond</div><div>
[(xexpr? data)</div><div> (write (xexpr->string data) out)]</div><div> [else</div><div> (error 'write-page "incremental responses unsupported")])))</div><div><br></div><div style>Almost, but output is not quite right:</div>
<div style><br></div><div style>"<html><head><title>My Web Site</title></head><body><p>Check out my <a href=\"cv.html\">CV.</a></p></body></html>"<br>
</div><div style><br></div><div style><br></div><div style>Any advice on how to do it correctly?</div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div><div style><br>
</div></div><div style><br></div><div style><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 30, 2013 at 1:15 PM, Jay McCarthy <span dir="ltr"><<a href="mailto:jay.mccarthy@gmail.com" target="_blank">jay.mccarthy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That package is incredibly old and used internal functions of the Web<br>
server. You'll have to look into what it was doing and update it to<br>
the modern documented server.<br>
<br>
Jay<br>
<div><div class="h5"><br>
On Tue, Apr 30, 2013 at 11:12 AM, J G Cho <<a href="mailto:gcho@fundingmatters.com">gcho@fundingmatters.com</a>> wrote:<br>
> While trying out dherman's site generator (from<br>
> planet.racket-lang.oracketg/package-source/dherman/static-page.plt/1/0/main.ss),<br>
> the following error is thrown:<br>
><br>
> normalize-response: unbound identifier<br>
><br>
> This procedure does not turn up in Search Manuals. Is there way to fix/work<br>
> around this?<br>
><br>
> jGc<br>
><br>
</div></div>> ____________________<br>
> Racket Users list:<br>
> <a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Jay McCarthy <<a href="mailto:jay@cs.byu.edu">jay@cs.byu.edu</a>><br>
Assistant Professor / Brigham Young University<br>
<a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>
"The glory of God is Intelligence" - D&C 93<br>
</font></span></blockquote></div><br></div>