[Top][All Lists]

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

Re: [Chicken-users] foreign-lambda return types

From: felix
Subject: Re: [Chicken-users] foreign-lambda return types
Date: Sun, 17 Aug 2003 23:11:31 +0200
User-agent: Opera7.11/Linux M2 build 406

On Sat, 16 Aug 2003 13:15:30 -0700, Burton Samograd <address@hidden> wrote:


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?

(define-foreign-type object-t (pointer void))

Note that the foreign-type definition is only visible in the currently
compiled file.


reply via email to

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