[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Strings from C?
From: |
Robert A. Uhl |
Subject: |
Re: Strings from C? |
Date: |
Wed, 17 Oct 2001 08:24:22 -0600 |
User-agent: |
Mutt/1.2.5i |
On Wed, Oct 17, 2001 at 11:21:11AM +0200, Matthias Koeppe wrote:
>
> You might want to consider using an interface generator like SWIG 1.3
> (http://www.swig.org) or g-wrap. This may save some work, and both
> tools know how to perform standard conversions between C and Scheme
> values.
Well, part of my problem is that in several places my methods take
GSList* (a singly-linked list from glib, for those who don't use that
library) as either an argument or return value. I was tempted to use
SWIG, but everything I saw indicated that there was no way to convert
between _my_ lists and guile's lists. Given that my application is
list-intensive, and that scheme is list-intensive, it would seem
pointless to simply wrap up more functions to create C lists from
scheme lists; something like:
(trav-mapobject-set-owners obj (gslist-new obj2 obj3 obj4))
or
(car (gslist-split (trav-mapobject-get-owners obj)))
is more than a little ugly, at least to my eyes. Perh. there is a way
to do this from SWIG after all? Obviously ideal would be able to write:
(trav-mapobject-set-owners obj '(obj2 obj3 obj4))
and
(car (trav-mapobject-get-owners obj))
Thanks much for the note.
--
Robert Uhl <address@hidden>
Merely having an open mind is nothing; the object of opening the mind,
as of opening the mouth, is to shut it again on something solid.
--G.K. Chesterton