[slime-devel] REPL problems

Madhu enometh at meer.net
Fri Jun 5 08:07:33 UTC 2009


* Madhu <m3r5y1ivt9.fsf at moon.robolove.meer.net> :
Wrote on Wed, 03 Jun 2009 13:38:18 +0530:

| * Benjamin L. Russell <6q572514ruc9h0td4fv6391hbtvqkmpa8v at 4ax.com> :
| Wrote on Mon, 01 Jun 2009 17:59:44 +0900:
|
| | I finally discovered a patch, posted by Samium Gromoff in the thread
| | "PATCH Output redirection in the SIMPLE SERVE EVENTS case." (see
| | http://article.gmane.org/gmane.lisp.slime.devel/8513), documenting
| | this bug and patching it.
| |
| | However, it introduced a new bug: This time, the banner does not
| | appear, and I get the following lines in my REPL at startup,
| | instead:
|
| [snip]
|
| | Anybody know how to patch this patch?  Apparently, this patch does
| | not seem to have been applied in the CVS version of swank.lisp
|
| No, I do not know how to fix the patch, and do not see your
| problem. But I'm appending a WIP patch on the lines of Samium's patch
| which I've tested on Lispworks/Linux.  1. I've not tried it with CLISP
| 2. This will not work on CMUCL.

FTR There were errors in the patch I posted here by mistake.  But for
the general idea in Samium Gramoff's patch to work, under CMUCL and
CLISP, and under the swank-stream-model-de-jour, the behaviour of
SWANK:MAKE-REPL-INPUT-STREAM needs to be change, along the lines of:


diff --git a/swank.lisp b/swank.lisp
index 4df8020..391c573 100644
--- a/swank.lisp
+++ b/swank.lisp
@@ -1358,18 +1359,16
                     :socket-open :socket-closed)
                 (if (open-stream-p stdin) 
                     :stdin-open :stdin-closed))
-     (loop
-      
-      (let* ((socket (connection.socket-io connection))
-             (inputs (list socket stdin))
-             (ready (wait-for-input inputs)))
-        (cond ((eq ready :interrupt)
-               (check-slime-interrupts))
-              ((member socket ready)
-               (handle-requests connection t))
-              ((member stdin ready)
-               (return (read-non-blocking stdin)))
-              (t (assert (null ready)))))))))
+     (loop (let* ((socket (connection.socket-io connection))
+                  (ready (or (and (listen stdin) (list stdin))
+                             (wait-for-input (list socket)))))
+             (cond ((eq ready :interrupt)
+                    (check-slime-interrupts))
+                   ((member socket ready)
+                    (handle-requests connection t))
+                   ((member stdin ready)
+                    (return (read-non-blocking stdin)))
+                   (t (assert (null ready)))))))))
 
 (defun read-non-blocking (stream)
   (with-output-to-string (str)





More information about the slime-devel mailing list