[plt-scheme] simple ffi problem

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jul 22 21:00:38 EDT 2005

The second example is bogus -- _cvector in input mode does not expect
a type, since the _cvector object contains its type.  Because of this
(_cvector i) is the same as _cvector.  But I think that the problem
that you see is due to some error when interacting with the foreign
module in Scheme -- I think it was mentioned once, but I don't know
where the problem is (yet).

On Jul 22, mike at nec-labs.com wrote:
> I grabbed the v299.108 binaries today, and still have the same problem...
> 
> > However, I can't get the syntax right for the external C function:
> >
> >    void fun2 (int in1, double *arr);
> >
> > I've tried:
> >
> >    (define fun2
> >      (get-ffi-obj "fun2" "myclib"
> >                   (_fun _int _cvector -> _void)))
> >
> > and
> >
> >    (define fun2
> >      (get-ffi-obj "fun2" "myclib"
> >                   (_fun _int (_cvector i _double) -> _void)))
> >
> > but keep getting errors like:
> >
> >    procedure application: expected procedure, given: #f;
> >      arguments were: #<struct:fun-syntax> #<syntax:36:26>

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!



Posted on the users mailing list.