[plt-scheme] Eli Barzilay's new FFI stuff

From: Eli Barzilay (eli at barzilay.org)
Date: Sun Aug 8 14:41:37 EDT 2004

On Aug  8, Christopher Armstrong wrote:
> On Sat, 7 Aug 2004 21:42:52 -0400, Christopher Armstrong
> <radeex at gmail.com> wrote:
> > On Sat, 7 Aug 2004 21:22:06 -0400, Eli Barzilay <eli at barzilay.org> wrote:
> > >
> > > The (_bytes ...) macro is something that should be used only in
> > > a (_fun ...) construct.  You should use _bytes instead.
> > 
> > Really? But that segfaults... How will it know how many bytes to
> > grab?
> Sorry, Eli, you don't have to worry about this any more. There's
> already a C function defined that extracts the value of the string,
> and that + make-sized-byte-string did the trick for me. So support
> isn't necessary for my use case any more, although it still seems
> kinda sucky that the FFI can't extract it itself.

Well, you could run make-sized-byte-string on the struct pointer, but
you're right -- this is a problem that needs some solution.  (There
are some delicate macro issues involved.)

> Anyway, thanks a lot for the help you've given me, and I'm sorry for
> bugging you so much ;-) All of my *major* problems have been solved,
> and I can continue hacking on my stuff (except for that extra-copying
> that's necessary for the super-struct-fields, but that's not a
> show-stopper yet). You've been a great help. :-)

I'll do that thing too.

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

Posted on the users mailing list.