gunter at peterpall.de
Fri Feb 15 17:30:27 UTC 2019
Maxima (which is written in lisp) connects to its front-end using a
network socket. stdout and stderr of the lisp are redirected to this
If the front-end dies unexpectedly this seems to cause ECL to output an
error message which (since it cannot be output) causes an error message
On gcl maxima just catches the SIGPIPE signal and exits if the pipe
breaks. ECL offers ECL_OPT_TRAP_SIGPIPE but I don't know what to do with it.
Could anyone give me a hand?
the function that sets up the server is:
(defun setup-client (port &optional (host "localhost"))
;; The following command has to be executed on windows before
;; the connection is opened. If it isn't the first unicode
;; character maxima wants to send causes sbcl to wait indefinitely.
#+sbcl (setf sb-impl::*default-external-format* :utf-8)
(multiple-value-bind (sock condition) (ignore-errors (open-socket host
; It appears that we were unable to open a socket or connect to the
; specified port.
(mtell (intl:gettext "~%Unable to connect Maxima to port ~:M.~%")
(mtell (intl:gettext "Error: ~A~%") condition)
#+gcl (setq si::*sigpipe-action* 'si::bye)
(setq *socket-connection* sock)
(setq $old_stderr *error-output*
#+ecl (setq *old-stdin* *standard-input*
(setq *standard-input* sock)
(setq *standard-output* sock)
(setq *error-output* sock)
(setq *terminal-io* sock)
(setq *trace-output* sock)
(format t "pid=~a~%" (getpid))
(setq *debug-io* sock))
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ecl-devel