LINUX.ORG.RU

Вроде, компилится...

--- cl-octave.lisp.bak	2005-11-23 10:31:01.000000000 +0100
+++ cl-octave.lisp	2008-01-22 12:52:08.000000000 +0100
@@ -33,7 +33,7 @@
 
 ;;; Contact: Fred Nicolier
 ;;;          Dept Ge2i, IUT
-;;;          9 rue de Québec
+;;;          9 rue de Quebec
 ;;;          10026 Troyes Cedex
 ;;; email:   f.nicolier(At)iut-troyes.univ-reims.fr
 ;;; 
@@ -62,9 +62,12 @@
 (in-package :common-lisp-user)
 
 (defpackage :cl-octave
-  (:use :common-lisp
-        :extensions
-        :system)
+  (:use :common-lisp)
+  #+cmu
+  (:use :extensions :system :unix)
+  #+sbcl
+  (:use :sb-ext :sb-sys :sb-unix)
+
   (:export :start-octave
            :stop-octave
            :set/octave
@@ -87,8 +90,7 @@
 nothing. CMUCL specific."
   (when (not *octave-process*)
     ;;    (ext:run-program "mkfifo" '("cl2o.dat" "o2cl.dat"))
-    #+cmu
-    (setf *octave-process* (ext:run-program "octave" '("-qi")
+    (setf *octave-process* (run-program "octave" '("-qi")
                                             :wait nil
                                             :input :stream
                                             :output :stream
@@ -102,8 +104,7 @@ specific."
   (when *octave-process*
     (process-close *octave-process*)
     (setf *octave-process* nil)
-    #+cmu
-    (ext:run-program "rm" '("-f" "cl2o.dat" "o2cl.dat"))))
+    (run-program "rm" '("-f" "cl2o.dat" "o2cl.dat"))))
 
 ;;;## Send and receive raw strings
 
@@ -163,9 +164,8 @@ complex numbers"))
               (set/octave "_imag" (map/array #'imagpart flat-a))
               (eval/octave name "=_real+i*_imag;"))
             (with-open-file (f "cl2o.dat" :direction :output :if-exists :supersede)
-              #+cmu
-              (unix:unix-write (system:fd-stream-fd f)
-                               (system:vector-sap (coerce flat-a `(simple-array ,elt-type (*))))
+              (unix-write (fd-stream-fd f)
+                               (vector-sap (coerce flat-a `(simple-array ,elt-type (*))))
                                0
                                (* lisp-nb-bytes (length flat-a)))
               (eval/octave "f=fopen('cl2o.dat');"
@@ -189,8 +189,8 @@ complex numbers"))
     (with-open-file (f "o2cl.dat" :direction :input :if-exists :supersede)
       (let* ((length (round (get-as-number (string-cat "prod(size(" name "))"))))
              (result (make-array length :element-type element-type)))
-        (unix:unix-read (system:fd-stream-fd f)
-                        (system:vector-sap result)
+        (unix-read (fd-stream-fd f)
+		   (vector-sap result)
                         (* lisp-nb-bytes length))
         result))))
 

mv ★★★★★
()
Ответ на: комментарий от mv

Да, так скомпилилась. Но не хочет ничего выполнять.
На (exec/octave "plot" #(1.0 2.0 3.0 2.0 -10.0)) 
(set/octave "b" #(1.0 2.0 3.0))

Ошибка:
Array element type of :DISPLACED-TO array does not match specified
element type

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.