[plt-scheme] libusb FFI binding

From: Jakub Piotr Cłapa (jpc at pld-linux.org)
Date: Mon Mar 5 08:24:16 EST 2007

Eli Barzilay wrote:
> On Mar  5, Jakub Piotr C$,1 b(Bapa wrote:
>> [...]
>> Btw. apropos FFI:
>> 1. PATH_MAX (and maybe some other C constants) could be exported in 
>> %foreign. It would make the bindings more bullet proof.
> These are usually defined as preprocessor constants -- so these
> constants don't really exist.  Having them requires parsing the source
> files.

As Matthew pointed out this is a system-wide constant. It exists on 
Linux, OS X and Windows so I guess it's not so bad even if being 

> There are of course lots of ways to implement enumerations...  In some
> situations you may want to have a more efficient hash tables, you
> could want to have proper bindings (use (logior foo bar) instead of
> '(foo bar)) etc etc.  The foreign interface can't cover all of them,
> so instead it's making it easy to implement your own types.

I'll see what I can do myself. It could go to the Cookbook as an 
example. :-)

Jakub Piotr Cłapa

Posted on the users mailing list.