[racket] Sending a cvector to foreign functions.

From: Noel Welsh (noelwelsh at gmail.com)
Date: Tue Jan 25 08:33:30 EST 2011

Your code looks correct to me. Things you might try:

- Check tiles are constructed correctly
- Replace _cvector with (_cvector i _tile) for increased error checking

Sorry I can't be more helpful. These problems are really hard to debug
as the errors could be in so many places.


On Tue, Jan 25, 2011 at 7:07 AM, Lewis <lewis1711 at gmail.com> wrote:
> Right you are Noel it turns out the C code had a few bugs of its own.
> I have independently tested it now, and all is working fine from
> there.
> The C prototype is now
> void render(int x_camera, int y_camera, Visual pc, Tile* world);
> However I still get the error.
> http://paste.pocoo.org/show/326448/
> Here are the relevant bits of racket code, including the error. I
> would much appreciate if anyone could tell me if I am doing something
> obviously wrong.
> The main ithing I am confused about is... *how do I send a information
> from racket to a C function that expects an array*
> Thanks,
> Lewis

Posted on the users mailing list.