[plt-scheme] foreign: am I missing something basic?

From: Dave Herman (dherman at ccs.neu.edu)
Date: Wed Sep 23 22:15:29 EDT 2009

I wanted to peek inside the bits of a Scheme data structure, so to get  
my feet wet I created a little DLL that does the following:

     #include "scheme.h"
     short peek_inside(Scheme_Object *x)
         return x->type;

and then in Scheme I did:

     (require scheme/foreign)
     (define lib (ffi-lib "path/to/mylib"))
     (define peek-inside
       (get-ffi-obj 'peek_inside lib (_cprocedure (list _scheme)  
     (peek-inside #'stx-obj)

But in Windows, the last expression crashes DrScheme. I tried it on my  
MacBook and it worked. Is there something obvious I'm doing wrong?


Posted on the users mailing list.