From 22db3628ab77e8bf67ee32d6d81c022ba2e7b238 Mon Sep 17 00:00:00 2001 From: frese Date: Mon, 26 Jul 2004 16:25:57 +0000 Subject: [PATCH] - renamed tsend-line to tsend/cr - removed functions implemented in srfi-1 --- scheme/expect-syntax.scm | 16 ---------------- scheme/expect.scm | 4 +++- scheme/packages.scm | 16 +++++++++------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/scheme/expect-syntax.scm b/scheme/expect-syntax.scm index fd294ce..1333535 100644 --- a/scheme/expect-syntax.scm +++ b/scheme/expect-syntax.scm @@ -23,22 +23,6 @@ (let ((v exp)) (mlet (init ...) body ...))))) -(define (filter pred lis) - (if (pair? lis) - (let ((x (car lis))) - (if (pred x) (cons x (filter pred (cdr lis))) - (filter pred (cdr lis)))) - '())) - -(define (partition pred lis) - (if (pair? lis) - (let ((x (car lis))) - (receive (ins outs) (partition pred (cdr lis)) - (if (pred x) - (values (cons x ins) outs) - (values ins (cons x outs))))) - (values '() '()))) - ;;; This is a hairy mother. If you ever try to read it or change it, you are ;;; advised to first try expanding a couple of toy examples and looking at the ;;; output to get a feel for the basic compilation strategy. diff --git a/scheme/expect.scm b/scheme/expect.scm index a69cd71..ee2fa9c 100644 --- a/scheme/expect.scm +++ b/scheme/expect.scm @@ -6,6 +6,8 @@ ;;; - Fairness & round-robin looping ;;; - If all tasks eof, should we detect this and bail out early? ;;; - I need a little toolkit for constructing monitors. +;;; - A wrapper that gives a spawned process a tty with the same +;;; options as the current tty. ;;; If I had infinite-pushback ports, I could flush the "task" structure ;;; entirely. This would be better done with a transducer architecture. @@ -56,7 +58,7 @@ (define (tsend task fmt . args) (apply format (task:out task) fmt args)) -(define tsend-line +(define tsend/cr (let ((cr (string-ref "\r" 0))) ; Ugh (lambda (task fmt . args) (let ((p (task:out task))) diff --git a/scheme/packages.scm b/scheme/packages.scm index e6d470c..cc5a295 100644 --- a/scheme/packages.scm +++ b/scheme/packages.scm @@ -1,11 +1,11 @@ (define-structure tty-utils (export modify-tty echo-off echo-on raw raw-initialize) - (open scsh let-opt scheme) + (open scheme-with-scsh let-opt) (files tty-utils)) (define-structure expect-syntax-support (export expand-expect) - (open scheme structure-refs + (open scheme structure-refs srfi-1 receiving) ; for making alien containers. (access signals) ; for ERROR (files expect-syntax)) @@ -23,13 +23,15 @@ user-task file->task ports->task close-task wait-task close-task spawn* (spawn :syntax) - tsend tsend-line + tsend tsend/cr (expect :syntax) + + interact* interact/char* (interact :syntax)) (for-syntax (open expect-syntax-support scheme)) - (open scsh formats structure-refs - receiving srfi-9 scheme srfi-13) + (open scheme-with-scsh formats structure-refs let-opt + receiving srfi-9 srfi-13 srfi-1) (access signals) ; for ERROR (files expect interact)) @@ -41,13 +43,13 @@ (chat :syntax) send send/cr) - (open scsh expect fluids scheme) + (open scheme-with-scsh expect fluids) (files chat)) (define-structure printf-package (export printf sprintf display/cr display/nl) - (open scsh formats scheme) + (open scheme-with-scsh formats) (begin