Correct self links & restructure a bit.
This commit is contained in:
parent
9a6b262637
commit
862dd31c88
|
@ -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))
|
|
||||||
(number2 (get-number2)))
|
|
||||||
(send-html
|
(send-html
|
||||||
`(html (title "Result")
|
`(html (title "Result")
|
||||||
(body (h2 "Result")
|
(body (h2 "Result")
|
||||||
(p ,(number->string (+ number1 number2)))
|
(p ,(number->string (+ (get-number1) (get-number2)))
|
||||||
(hr)
|
(hr)
|
||||||
(p (URL "add-surflet.scm" "Make new calculation.") (br)
|
(p (URL "add-surflet.scm" "Make new calculation.") (br)
|
||||||
(URL "javascript:history.go(-2)" "New calculation (same session)")
|
(URL "javascript:history.go(-2)" "New calculation (same session)")
|
||||||
(br)
|
(br)
|
||||||
(URL "/" "Return to main menu.")))))
|
(URL "/" "Return to main menu."))))))
|
||||||
|
|
||||||
"this string will never be evaluated"))
|
"this string will never be evaluated")
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue