Re: [Chicken-users] foreign-lambda - how to declare double array as argument and how to pass things to it?
Did you try passing in an f64vector instead of a vector? On 11/11/07, Terrence Brannon <[EMAIL PROTECTED]> wrote: > 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 ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] foreign-lambda - how to declare double array as argument and how to pass things to it?
Well, no here is what I did: (let ([vec (vector 0 1 1)]) (polevl 42 vec (vector-length vec))) how would I pass in an f64 vec? and was I right in choosing f64vec on the chicken side for a C function with this signature: double polevl( x, coef, N ) double x; double coef[]; int N; { ... } On Nov 11, 2007 10:37 PM, Zbigniew <[EMAIL PROTECTED]> wrote: > Did you try passing in an f64vector instead of a vector? > > > On 11/11/07, Terrence Brannon <[EMAIL PROTECTED]> wrote: > > 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 > ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users
Re: [Chicken-users] foreign-lambda - how to declare double array as argument and how to pass things to it?
srfi-4 doc is a good place to look for info on number-vectors. All you need do there is replace vector with f64vector and vector-length with f64vector-length. I think this should work. On 11/12/07, Terrence Brannon <[EMAIL PROTECTED]> wrote: > Well, no here is what I did: > (let ([vec (vector 0 1 1)]) (polevl 42 vec (vector-length vec))) > > how would I pass in an f64 vec? ___ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users