The following works in sbcl+grid:<br><br>(copy-to (make-array 2 :element-type 'double-float :initial-contents '(1.0d0 2.0d0)) 'grid:foreign-array)<br><br>But it does not work in clisp+grid.<br><br>The root cause lies in the function grid/array.lisp/element-type. It uses `(array-element-type grid)'. <br>
<br>But this can present a problem. Quoting hyperspec:<br><br>(Because of <a href="26_glo_a.htm#array" rel="DEFINITION"><i>array</i></a>
<i>upgrading</i>, this <a href="26_glo_t.htm#type_specifier" rel="DEFINITION"><i>type specifier</i></a> can in some cases denote a <a href="26_glo_s.htm#supertype" rel="DEFINITION"><i>supertype</i></a> of the <a href="26_glo_e.htm#expressed_array_element_type" rel="DEFINITION"><i>expressed
array element type</i></a> of the <i>array</i>.) <br><br>In CLISP, array-element-type returns `T' when passed #(1d0 2d0)<br><br>It returns T even when passed a simple array:<br><br>(array-element-type (make-array 2 :element-type 'double-float :initial-contents<br>
'(1.0d0 2.0d0)<br> :adjustable nil<br> :fill-pointer nil<br> :displaced-to nil) )<br><br>The proposed fix is<br><br>(defmethod element-type ((grid array))<br>
(type-of (row-major-aref grid 0))<br> #+skip(array-element-type grid))<br><br>Now copy-to works in clisp as well.<br><br>Mirko<br><br><br>