(require (lib "unitsig.ss") (lib "servlet-sig.ss" "web-server")) (unit/sig () (import servlet^) (report-errors-to-browser send/finish) ; Get all the responses seen so far. (define (get-responses-list) (if (file-exists? "all-requests-to-respond") (let* ((port (open-input-file "all-requests-to-respond")) (responses-list (read port))) (close-input-port port) (if (eof-object? responses-list) '() responses-list)) '())) (define (list-responses rl) (if (null? rl) '((p "And nothing else.")) (cons `(p "You have said that every " ,(list-ref (car rl) 0) " is a " ,(list-ref (car rl) 1) ".") (list-responses (cdr rl))))) `(html (head (title "Summary of all Relationships")) (body ([bgcolor "white"]) ,@ (list-responses (get-responses-list)))) )