guile-devel
[Top][All Lists]
Advanced

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

Newbie question on writing bindings.


From: Joel Smith
Subject: Newbie question on writing bindings.
Date: Sat, 14 Apr 2001 21:59:27 +0000 (GMT)

Hi,

I am new to guile and fairly new to scheme but I am attempting to write 
some bindings for a C library that I want to use from guile. I have hit a 
problem and I am not sure how to solve it.

Some of the C functions that I want to call from guile take a flag 
argument which is made from a set of values or'ed together. For example:

#define FOO     1
#define BAR     2

...

baz( FOO | BAR );

How do I write bindings for such functions? I thought about passing the 
various values as a list but that does not seem like the Right Thing to 
me. I also thought of using keyword arguments like this:

(baz #:foo #t :#bar #t)

But I don't know how to write a C routine to handle keyword arguments. I 
have looked at other guile code to see if anyone else has solved this 
problem but I could not find any examples of it. Surely I can't be the 
only person who wants to do this? ;-) Any help would be much appreciated!

Happy Hacking,

Joel.




reply via email to

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