* Redirect output from interactive Scheme Program to OPORT (to browser).
* Add definition for GET-HEADER (does every package need its own definition?)
This commit is contained in:
parent
416d914a3f
commit
6804ad4712
|
@ -68,7 +68,8 @@
|
||||||
(with-tag oport PRE ()
|
(with-tag oport PRE ()
|
||||||
(newline oport)
|
(newline oport)
|
||||||
(force-output oport); In case we're gunned down.
|
(force-output oport); In case we're gunned down.
|
||||||
(eval-safely sexp)))
|
(with-current-output-port oport
|
||||||
|
(eval-safely sexp))))
|
||||||
|
|
||||||
;; Pretty-print the returned value(s).
|
;; Pretty-print the returned value(s).
|
||||||
(emit-header oport 2 "Return value(s)")
|
(emit-header oport 2 "Return value(s)")
|
||||||
|
@ -102,3 +103,8 @@
|
||||||
"Seval sexp: ~s" s)
|
"Seval sexp: ~s" s)
|
||||||
(read (make-string-input-port s)))))
|
(read (make-string-input-port s)))))
|
||||||
(else (error "No `Content-length:' field in POST request."))))
|
(else (error "No `Content-length:' field in POST request."))))
|
||||||
|
|
||||||
|
(define (get-header headers tag)
|
||||||
|
(cond
|
||||||
|
((assq tag headers) => cdr)
|
||||||
|
(else #f)))
|
Loading…
Reference in New Issue