From 7c33c9ba089e28195145786d5a5c1500a58a8478 Mon Sep 17 00:00:00 2001 From: interp Date: Sun, 19 Jan 2003 09:47:15 +0000 Subject: [PATCH] minor restructuring --- .../web-server/root/surflets/news.scm | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/scheme/httpd/surflets/web-server/root/surflets/news.scm b/scheme/httpd/surflets/web-server/root/surflets/news.scm index 3ee1e81..79ae2c8 100644 --- a/scheme/httpd/surflets/web-server/root/surflets/news.scm +++ b/scheme/httpd/surflets/web-server/root/surflets/news.scm @@ -15,20 +15,26 @@ (if (null? *data*) (read-data)) (let loop ((count (- (length *data*) 1))) (if (< count 0) - (send-html/finish - `(html (body (p (h1 "THAT'S IT")) - (p ("That's it...")) - (hr) - (p (URL "news.scm" "See news again.") (br) - (URL "/" "Return to main menu."))))) + (show-final-page) (begin - (send-html/suspend - (lambda (next-url) - `(html (body (p (h1 ,(list-ref *data* count))) - (a (@ href ,next-url) "read more...") - (hr) - (p (URL "news.scm" "See news again from beginning.") (br) - (URL "/" "Return to main menu.")))))) + (show-news-page count) (loop (- count 1)))))) + + (define (show-final-page) + (send-html/finish + `(html (body (p (h1 "THAT'S IT")) + (p ("That's it...")) + (hr) + (p (URL "news.scm" "See news again.") (br) + (URL "/" "Return to main menu.")))))) + + (define (show-news-page count) + (send-html/suspend + (lambda (next-url) + `(html (body (p (h1 ,(list-ref *data* count))) + (a (@ href ,next-url) "read more...") + (hr) + (p (URL "news.scm" "See news again from beginning.") (br) + (URL "/" "Return to main menu."))))))) ))