[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] foreign-lambda return types

From: Burton Samograd
Subject: [Chicken-users] foreign-lambda return types
Date: Sat, 16 Aug 2003 13:15:30 -0700
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)


The library I'm trying to write a wrapper for is based on
pseudo-object oriented C, which contains procedures like

object_t* object_new()
void object_delete(object_t*)

I've gotten the wrapper working by doing:

(define object-new (foreign-lambda (pointer void) object_new void))
(define object-delete (foreign-lambda void object_delete (pointer void)))

but what I would like to do is something like:

(define object-t '(pointer void))
(define object-new (foreign-lambda object-t object_new void)
(define object-delete (foreign-lambda void object_new object-t)

which gives me the following error when I compile:

Error: illegal foreign return type object-t

I think what I'm really trying to do is just a string replacement at
compile time for object-t -> (pointer void), but my macro writing
skills aren't up to par for that yet.

Could someone help me out with an example on how to get this to work?


burton samograd

reply via email to

[Prev in Thread] Current Thread [Next in Thread]