[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Mapping one Scheme argument to two C arguments
From: |
Andy Wingo |
Subject: |
Re: Mapping one Scheme argument to two C arguments |
Date: |
Fri, 25 Mar 2005 19:27:15 +0100 |
Hi Ludovic,
On Thu, 2005-03-24 at 11:38 +0100, Ludovic Courtès wrote:
> (define-method (call-arg-cg (type <chop-input-buffer-type>)
> (value <gw-value>))
> (let ((size-var (string-append (var value) "_size")))
> (list (var value) ", " size-var)))
Sneaky ;) I think there's probably a cleaner way to do this, but this
method is convenient.
That said, the best wrapping for a read/write interface is to use ports.
Guile's port implementation is terribly nasty, but it is possible to
implement custom port types. (gnome gnome-vfs) shows how to do it. Then
you have all the normal functions and port behavior.
g-wrap could provide some abstractions for port-like interfaces, but it
would need to be implemented, and guile needs some cleaning up, too.
Just a suggestion :)
--
Andy Wingo
http://wingolog.org/