[Openmcl-devel] Error when setting a value in a matrix unless safety 3

Stas Boukarev stassats at gmail.com
Tue May 12 22:45:04 UTC 2009


Keith James <kdj at sanger.ac.uk> writes:

> Hi,
>
> I'm porting some of my libraries that were developed on SBCL and
> LispWorks. I'm experiencing an error that I can't explain when setting
> a value (a single-float) into a type-declared matrix of single
> floats. I've discovered that I can avoid the error by setting safety 3.
>
> The error message is
>
> value -5.0 is not of the expected type (SIMPLE-ARRAY DOUBLE-FLOAT (* *))
>
> As the algorithm is very compute intensive (Smith-Waterman alignment),
> I would like to optimize for speed and slightly reduced safety. I have
> extracted the smallest self-contained example that I can, illustrating
> the problem.
>
> Most of the code has been macroexpanded, hence the odd variable
> names. I've commented the exact point of the error. Any suggestions
> would be much appreciated.
>
> I'm using Version 1.3-r11936 (LinuxX8664). 

I was able to reduce to the following:

(defun test ()
  (let ((array (make-array '(1 1) :initial-element 2.0
                           :element-type 'single-float))
        (var 1.0))
    (setf (aref array 0 0) var
          var nil)))

And it doesn't trigger on LinuxX8632.          
   
-- 
With best regards, Stas.



More information about the Openmcl-devel mailing list