scratch - char-continuation functions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
(define-interface scratch-interface
|
||||
(export
|
||||
run-daemon-child-http))
|
||||
char-continue))
|
||||
|
||||
(define-structure thttpd
|
||||
scratch-interface
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(define-package "thttpd"
|
||||
(define-package "scratch"
|
||||
(0 1)
|
||||
((install-lib-version (1 3 0)))
|
||||
(write-to-load-script
|
||||
@@ -8,5 +8,4 @@
|
||||
(install-file "README" 'doc)
|
||||
(install-file "NEWS" 'doc)
|
||||
(install-string (COPYING) "COPYING" 'doc)
|
||||
(install-file "packages.scm" 'scheme)
|
||||
(install-file "tserver.scm" 'scheme))
|
||||
(install-file "scratch.scm" 'scheme))
|
||||
|
||||
@@ -26,20 +26,19 @@
|
||||
;;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
;;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
(define (get-response-f lst)
|
||||
(define (get return)
|
||||
(define (char-continue lst)
|
||||
(define (get-char return)
|
||||
(for-each
|
||||
(lambda (element)
|
||||
(set! return (call-with-current-continutation
|
||||
(lambda (r)
|
||||
(set! get r)
|
||||
(set! get-char r)
|
||||
(return element)))))
|
||||
lst)
|
||||
(return 'end-generate))
|
||||
|
||||
(define (gen)
|
||||
(call-with-current-continuation get))
|
||||
(call-with-current-continuation get-char))
|
||||
gen)
|
||||
|
||||
(define (get-response l)
|
||||
(get-response-f l))
|
||||
;; test
|
||||
;; (char-continue l) generates the chars with each call
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
(call-with-current-continuation get))
|
||||
gen)
|
||||
|
||||
(define (get-response l)
|
||||
(define (get-response l) ;; make l public and generate without args
|
||||
(get-response-f l))
|
||||
|
||||
(define (run-daemon-child-http rec)
|
||||
|
||||
Reference in New Issue
Block a user