REPL Server: Redirect warnings to client socket.
authorMark H Weaver <mhw@netris.org>
Tue, 4 Feb 2014 17:08:48 +0000 (12:08 -0500)
committerMark H Weaver <mhw@netris.org>
Tue, 4 Feb 2014 20:15:00 +0000 (15:15 -0500)
* module/system/repl/server.scm (serve-client): Use parameterize.
  Redirect warnings to client socket.

module/system/repl/server.scm

index 2df7564..bbabaef 100644 (file)
@@ -1,6 +1,6 @@
 ;;; Repl server
 
-;; Copyright (C)  2003, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C)  2003, 2010, 2011, 2014 Free Software Foundation, Inc.
 
 ;; This library is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU Lesser General Public
 (define (serve-client client addr)
   (with-continuation-barrier
    (lambda ()
-     (with-input-from-port client
-       (lambda ()
-         (with-output-to-port client
-           (lambda ()
-             (with-error-to-port client
-               (lambda ()
-                 (with-fluids ((*repl-stack* '()))
-                   (start-repl))))))))))
+     (parameterize ((current-input-port client)
+                    (current-output-port client)
+                    (current-error-port client)
+                    (current-warning-port client))
+       (with-fluids ((*repl-stack* '()))
+         (start-repl)))))
   (close-socket! client))