[slime-cvs] CVS slime

heller heller at common-lisp.net
Sun Aug 31 11:58:02 UTC 2008


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv19207

Modified Files:
	ChangeLog swank-abcl.lisp swank-backend.lisp swank-cmucl.lisp 
	swank-gray.lisp swank-scl.lisp swank.lisp 
Log Message:
* swank-backend.lisp (make-input-stream): Remove make-fn-streams.
Update callers accordingly.

--- /project/slime/cvsroot/slime/ChangeLog	2008/08/31 08:49:28	1.1489
+++ /project/slime/cvsroot/slime/ChangeLog	2008/08/31 11:58:01	1.1490
@@ -2,6 +2,8 @@
 
 	* swank-backend.lisp (*gray-stream-symbols*): Remove
 	stream-file-position because it's called stream-position in CCL.
+	(make-input-stream): Remove make-fn-streams.
+	Update callers accordingly.
 
 2008-08-30  Helmut Eller  <heller at common-lisp.net>
 
--- /project/slime/cvsroot/slime/swank-abcl.lisp	2008/08/30 15:33:20	1.52
+++ /project/slime/cvsroot/slime/swank-abcl.lisp	2008/08/31 11:58:01	1.53
@@ -28,12 +28,8 @@
   (ext:make-slime-output-stream write-string))
 
 (defimplementation make-input-stream (read-string)
-  (ext:make-slime-input-stream read-string))
-
-(defimplementation make-fn-streams (input-fn output-fn)
-  (let* ((output (ext:make-slime-output-stream output-fn))
-         (input  (ext:make-slime-input-stream input-fn output)))
-    (values input output)))
+  (ext:make-slime-input-stream read-string  
+                               (make-synonym-stream '*standard-output*)))
 
 (defimplementation call-with-compilation-hooks (function)
   (funcall function))
--- /project/slime/cvsroot/slime/swank-backend.lisp	2008/08/30 15:33:24	1.148
+++ /project/slime/cvsroot/slime/swank-backend.lisp	2008/08/31 11:58:01	1.149
@@ -469,17 +469,6 @@
   "Return a new character input stream.
 The stream calls READ-STRING when input is needed.")
 
-(definterface make-fn-streams (input-fn output-fn)
-   "Return character input and output streams backended by functions.
-When input is needed, INPUT-FN is called with no arguments to
-return a string.
-When output is ready, OUTPUT-FN is called with the output as its
-argument.
-
-Output should be forced to OUTPUT-FN before calling INPUT-FN.
-
-The streams are returned as two values.")
-
 
 ;;;; Documentation
 
--- /project/slime/cvsroot/slime/swank-cmucl.lisp	2008/08/27 17:53:08	1.190
+++ /project/slime/cvsroot/slime/swank-cmucl.lisp	2008/08/31 11:58:01	1.191
@@ -202,11 +202,6 @@
 (defimplementation make-input-stream (read-string)
   (make-slime-input-stream read-string))
 
-(defimplementation make-fn-streams (input-fn output-fn)
-  (let* ((output (make-slime-output-stream output-fn))
-         (input  (make-slime-input-stream input-fn output)))
-    (values input output)))
-
 (defstruct (slime-output-stream
              (:include lisp::lisp-stream
                        (lisp::misc #'sos/misc)
@@ -298,16 +293,12 @@
                        (lisp::misc #'sis/misc))
              (:conc-name sis.)
              (:print-function %print-slime-output-stream)
-             (:constructor make-slime-input-stream (input-fn sos)))
+             (:constructor make-slime-input-stream (input-fn)))
   (input-fn nil :type function)
-  ;; We know our sibling output stream, so that we can force it before
-  ;; requesting input.
-  (sos      nil :type slime-output-stream)
   (buffer   ""  :type string)
   (index    0   :type kernel:index))
 
 (defun sis/in (stream eof-errorp eof-value)
-  (finish-output (sis.sos stream))
   (let ((index (sis.index stream))
 	(buffer (sis.buffer stream)))
     (when (= index (length buffer))
--- /project/slime/cvsroot/slime/swank-gray.lisp	2008/08/30 15:33:49	1.18
+++ /project/slime/cvsroot/slime/swank-gray.lisp	2008/08/31 11:58:01	1.19
@@ -164,10 +164,3 @@
 
 (defimplementation make-input-stream (read-string)
   (make-instance 'slime-input-stream :input-fn read-string))
-
-(defimplementation make-fn-streams (input-fn output-fn)
-  (let* ((output (make-instance 'slime-output-stream 
-                                :output-fn output-fn))
-         (input  (make-instance 'slime-input-stream
-                                :input-fn input-fn)))
-    (values input output)))
--- /project/slime/cvsroot/slime/swank-scl.lisp	2008/08/08 13:43:33	1.22
+++ /project/slime/cvsroot/slime/swank-scl.lisp	2008/08/31 11:58:01	1.23
@@ -100,19 +100,17 @@
    (index :initarg :index :initform 0 :type fixnum)
    (position :initarg :position :initform 0 :type integer)
    (interactive :initarg :interactive :initform nil :type (member nil t))
-   (output-stream :initarg :output-stream :initform nil)
    (input-fn :initarg :input-fn :type function)
    ))
 
-(defun make-slime-input-stream (input-fn &optional output-stream)
+(defun make-slime-input-stream (input-fn)
   (declare (function input-fn))
   (make-instance 'slime-input-stream
                  :in-buffer (make-string 256)
                  :in-head 0 :in-tail 0
                  :out-buffer ""
                  :buffer "" :index 0
-                 :input-fn input-fn
-                 :output-stream output-stream))
+                 :input-fn input-fn))
 
 (defmethod print-object ((s slime-input-stream) stream)
   (print-unreadable-object (s stream :type t)))
@@ -202,11 +200,8 @@
            (incf (slot-value stream 'position) copy)
 	   copy)
 	  (waitp
-           (let ((output-stream (slot-value stream 'output-stream))
-                 (input-fn (slot-value stream 'input-fn)))
+           (let ((input-fn (slot-value stream 'input-fn)))
              (declare (type function input-fn))
-             (when output-stream
-               (force-output output-stream))
              (let ((new-input (funcall input-fn)))
                (cond ((zerop (length new-input))
                       -1)
@@ -344,10 +339,11 @@
 
 ;;;
 
-(defimplementation make-fn-streams (input-fn output-fn)
-  (let* ((output (make-slime-output-stream output-fn))
-         (input  (make-slime-input-stream input-fn output)))
-    (values input output)))
+(defimplementation make-output-stream (output-fn)
+  (make-slime-output-stream output-fn))
+
+(defimplementation make-input-stream (input-fn)
+  (make-slime-input-stream input-fn))
 
 
 ;;;; Compilation Commands
--- /project/slime/cvsroot/slime/swank.lisp	2008/08/30 15:33:39	1.580
+++ /project/slime/cvsroot/slime/swank.lisp	2008/08/31 11:58:01	1.581
@@ -824,25 +824,26 @@
 (defun open-streams (connection)
   "Return the 5 streams for IO redirection:
 DEDICATED-OUTPUT INPUT OUTPUT IO REPL-RESULTS"
-  (let ((output-fn (make-output-function connection))
-        (input-fn
-         (lambda () 
-           (with-connection (connection)
-             (with-simple-restart (abort-read
-                                   "Abort reading input from Emacs.")
-               (read-user-input-from-emacs))))))
-    (multiple-value-bind (in out) (make-fn-streams input-fn output-fn)
-      (let* ((dedicated-output (if *use-dedicated-output-stream*
-                                   (open-dedicated-output-stream
-                                    (connection.socket-io connection))))
-             (out (or dedicated-output out))
-             (io (make-two-way-stream in out))
-             (repl-results (make-output-stream-for-target connection
-                                                          :repl-result)))
-        (when (eq (connection.communication-style connection) :spawn)
-          (spawn (lambda () (auto-flush-loop out)) 
-                 :name "auto-flush-thread"))
-        (values dedicated-output in out io repl-results)))))
+  (let* ((output-fn (make-output-function connection))
+         (input-fn
+          (lambda () 
+            (with-connection (connection)
+              (with-simple-restart (abort-read
+                                    "Abort reading input from Emacs.")
+                (read-user-input-from-emacs)))))
+         (dedicated-output (if *use-dedicated-output-stream*
+                               (open-dedicated-output-stream
+                                (connection.socket-io connection))))
+         (out (make-output-stream output-fn))
+         (in (make-input-stream input-fn))
+         (out (or dedicated-output out))
+         (io (make-two-way-stream in out))
+         (repl-results (make-output-stream-for-target connection
+                                                      :repl-result)))
+    (when (eq (connection.communication-style connection) :spawn)
+      (spawn (lambda () (auto-flush-loop out))
+             :name "auto-flush-thread"))
+    (values dedicated-output in out io repl-results)))
 
 (defvar *maximum-pipelined-output-chunks* 20)
 
@@ -874,10 +875,7 @@
 
 (defun make-output-stream-for-target (connection target)
   "Create a stream that sends output to a specific TARGET in Emacs."
-  (nth-value 1 (make-fn-streams 
-                (lambda ()
-                  (error "Should never be called"))
-                (make-output-function-for-target connection target))))
+  (make-output-stream (make-output-function-for-target connection target)))
 
 (defun open-dedicated-output-stream (socket-io)
   "Open a dedicated output connection to the Emacs on SOCKET-IO.




More information about the slime-cvs mailing list