[plt-scheme] (lib "foreign.ss") and vararg C functions

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Oct 7 17:45:40 EDT 2005

On Oct  7, Richard Cobbe wrote:
> Is it possible to use (lib "foreign.ss") to call vararg C functions
> (like printf) from within Scheme?  It would be really nice to say,
> for example,
>     (c-printf "%04d" n)
> from time to time.

One of the limitations of libffi is that each function description is
fixed (unlike ffcall that was dropped due to its license).  But you
can define several Scheme-printfs with different arities and types.

On Oct  7, Robby Findler wrote:
> I bet there something that does that in swindle. ...

Surprising, but I never got to it...

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

Posted on the users mailing list.