[plt-scheme] Re: _bytes in FFI

From: Kyle Smith (airfoil at bellsouth.net)
Date: Fri Mar 16 00:07:18 EDT 2007

Eli Barzilay <eli at ...> writes:

> 
> On Mar 14, Pedro Pinto wrote:
> > Hi there,
> > 
> > It looks like the following:
> > 
> > (require (lib "foreign.ss")) (unsafe!)
> > 
> > (define libcrypt (ffi-lib "libcrypt"))
> > 
> > (define crypt
> >    (get-ffi-obj "crypt" libcrypt (_fun _string _string -> _bytes)))
> > 
> > 
> > will not work outside a module, at least on 360 on MacOS. I get:
> > 
> > procedure application: expected procedure, given: #f; arguments were:  
> > #<struct:fun-syntax> #<syntax:6:57>
> > 
> > The problem goes away if I replace _bytes with _pointer or if I wrap  
> > the whole thing in a module.
> > 
> > What gives?
> 
> I think that there was a problem with the syntax hacks that foreign.ss
> is doing when running in DrScheme.
> 
I don't know if this helps, but I get the exact same error message and I don't 
even have the libcrypt.dll, which I only found out when I placed the code in a 
module as Pedro had suggested made it work.  Is libcrypt.dll something you 
have to download from somewhere?

--kyle
airfoil at bellsouth dot com





Posted on the users mailing list.