[Maxima] xmaxima on CMUCL

Alexey Dejneka alexey@comail.ru
Tue, 24 Apr 2001 10:04:10 +0400


----Next_Part(Tue_Apr_24_10:00:30_2001_518)--
Content-Type: Text/Plain; charset=windows-1251
Content-Transfer-Encoding: quoted-printable

Here is a version of server.lisp, which works on cmucl. To use it with
xmaxima, change in bin/xmaxima the line

set ws_openMath(localMaximaServer) "[file join $ws_openMath(maximaPath) =
src/saved_maxima] -load [file join $ws_openMath(maximaPath) src/server.l=
isp] -eval \"(setup PORT)\" &"

to

set ws_openMath(localMaximaServer) "lisp -core [file join $ws_openMath(m=
aximaPath) src/maxima.core] -load [file join $ws_openMath(maximaPath) sr=
c/server-new.lisp] -eval \"(setup PORT)\" &"

---

----Next_Part(Tue_Apr_24_10:00:30_2001_518)--
Content-Type: Text/Plain; charset=windows-1251
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename*=windows-1251''server%2Dnew%2Elisp

;; very simple server started on port

(and (find-package "MAXIMA") (push :maxima *features*))

#+maxima
(in-package "MAXIMA")

;;; from CLOCC: <http://clocc.sourceforge.net>
(defun open-socket (host port &optional bin)
  "Open a socket connection to HOST at PORT."
  (declare (type (or integer string) host) (fixnum port) (type boolean b=
in))
  (let ((host (etypecase host
                (string host)
                (integer (hostent-name (resolve-host-ipaddr host))))))
    #+allegro (socket:make-socket :remote-host host :remote-port port
                                  :format (if bin :binary :text))
    #+clisp (lisp:socket-connect port host :element-type
                                 (if bin '(unsigned-byte 8) 'character))=

    #+cmu (sys:make-fd-stream (ext:connect-to-inet-socket host port)
                              :input t :output t :element-type
                              (if bin '(unsigned-byte 8) 'character))
    #+gcl (si:make-socket-stream host port bin) ; FIXME
    #+lispworks (comm:open-tcp-stream host port :direction :io :element-=
type
                                      (if bin 'unsigned-byte 'base-char)=
)
    #-(or allegro clisp cmu gcl lispworks)
    (error 'not-implemented :proc (list 'open-socket host port bin))))

(defun user::setup ( port &optional (host "localhost"))
  (let* ((sock (open-socket host port)))
    (setq me sock)
    (setq *socket-connection* me)
    (setq *standard-input* me)
    (setq *standard-output* me)
    (setq *error-output* me)
    (setq *terminal-io* me)
    (format t "pid=3D~a~%"
            #+cmu (unix:unix-getpid)
            #+gcl (si::getpid)
            #-(or cmu gcl) (error 'not-emplemented 'getpid))
    (setq *debug-io* me)
    ))

#+maxima
(progn
(setq $in_netmath t)
(setq $show_openplot nil))


----Next_Part(Tue_Apr_24_10:00:30_2001_518)----