Correct self links & restructure a bit.

This commit is contained in:
interp 2003-02-21 09:50:49 +00:00
parent 9a6b262637
commit 862dd31c88
1 changed files with 16 additions and 22 deletions

View File

@ -1,9 +1,6 @@
(define-structure surflet surflet-interface (define-structure surflet surflet-interface
(open surflets (open surflets
surflet-requests
url url
handle-fatal-error
let-opt
scheme-with-scsh) scheme-with-scsh)
(begin (begin
@ -23,13 +20,12 @@
,(make-submit-button))) ,(make-submit-button)))
(hr) (hr)
(p (URL "/" "Return to main menu.") (br) (p (URL "/" "Return to main menu.") (br)
(URL "add2.scm" "Start new calculation.")))))))) (URL "add-surflet.scm" "Start new calculation.")))))))
(if result (bindings (get-bindings result))
(or (input-field-value number-input-field (number (input-field-value number-input-field bindings)))
(form-query (http-url-search (if number
(surflet-request-url result)))) number
(get-number title "Please enter a valid number.")) (get-number title "Please enter a valid number."))))
(get-number title "Please enter a number."))))
(define (get-number1) (define (get-number1)
(get-number "Calculation - Step one" "First number:")) (get-number "Calculation - Step one" "First number:"))
@ -38,18 +34,16 @@
(get-number "Calculation - Step two" "Second number:")) (get-number "Calculation - Step two" "Second number:"))
(define (main req) (define (main req)
(let ((number1 (get-number1)) (send-html
(number2 (get-number2))) `(html (title "Result")
(send-html (body (h2 "Result")
`(html (title "Result") (p ,(number->string (+ (get-number1) (get-number2)))
(body (h2 "Result") (hr)
(p ,(number->string (+ number1 number2))) (p (URL "add-surflet.scm" "Make new calculation.") (br)
(hr) (URL "javascript:history.go(-2)" "New calculation (same session)")
(p (URL "add-surflet.scm" "Make new calculation.") (br) (br)
(URL "javascript:history.go(-2)" "New calculation (same session)") (URL "/" "Return to main menu."))))))
(br)
(URL "/" "Return to main menu.")))))
"this string will never be evaluated")) "this string will never be evaluated")
)) ))