[plt-scheme] Issue with Output _cvector Types Held in Variables

From: Henk Boom (lunarc.lists at gmail.com)
Date: Mon Jan 26 01:42:55 EST 2009

As I would expect, the ffi reports no error from the following (I'm
just using 'printf as an example, I know it makes no sense and is
dangerous):

#lang scheme/base
(require scheme/foreign)
(unsafe!)
(define test (get-ffi-obj 'printf #f (_fun (_cvector o _int 4) -> _void)))
(test)

If I put the cvector type in a variable, however:

#lang scheme/base
(require scheme/foreign)
(unsafe!)
(define t (_cvector o _int 4))
(define test (get-ffi-obj 'printf #f (_fun t -> _void)))
(test)

and I get the error:

ffi:printf: expects 1 argument, given 0

If I understand the documentation properly, the above two should be
identical, shouldn't they?

    Henk


Posted on the users mailing list.