scratch - char-continuation functions

This commit is contained in:
erana 2012-01-23 14:45:40 +09:00
parent 2937f43b3f
commit 54f0d2145a
4 changed files with 10 additions and 12 deletions

View File

@ -1,6 +1,6 @@
(define-interface scratch-interface
(export
run-daemon-child-http))
char-continue))
(define-structure thttpd
scratch-interface

View File

@ -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))

View File

@ -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

View File

@ -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)