I have this function in C:

double polevl( x, coef, N )
double x;
double coef[];
int N;
{
 ...
}

and I am trying to create foreign-lambda for it:

(define polevl
  (foreign-lambda double polevl double f64vector int))

But I know that double[] is wrong.

My guess was f64vector. That compiled, but passing a Scheme vector in failed:

#;2> (let ([vec (vector 0 1 1)]) (polevl 42 vec (vector-length vec)))
Error: bad argument type - not a number-vector or not of the correct type
#(0 1 1)
f64vector

        Call history:

        <syntax>                (let ((vec (vector 0 1 1))) (polevl 42 vec 
(vector-length vec)))
        <syntax>                (begin (polevl 42 vec (vector-length vec)))
        <syntax>                (polevl 42 vec (vector-length vec))
        <syntax>                (vector-length vec)
        <syntax>                (vector 0 1 1)
        <eval>          (vector 0 1 1)
        <eval>          (polevl 42 vec (vector-length vec))
        <eval>          (vector-length vec)     <--
#;2>


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to