Discussion:
working to update pointer->procedure
Matt Wette
2018-11-30 23:32:17 UTC
Permalink
Hi All,

I'm starting to look into libguile/foreign.c to add support for libffi's variadic
function calls. My thinking is that that pointer->procedure would accept '... as
the last element of the arg list, and that on procedure calls one would pass a pair
to for each unspecified argument. The car of the pair is the ffi type (e.g., int)
and the car is the value.

(use (system foreign))

(define scm-printf (pointer->procedure int (dynamic-func "printf") ('* '...)))

(scm-printf (string->pointer "ans=%d\n") (cons int 4))


Comments?

Matt

Loading...