On 10/31/05, Pupeno <[EMAIL PROTECTED]> wrote:
>
> Does define-foreign-record work for unions as well ?
>

Yes, this should work. Record accessors expand into simple
component access ("return(abc->xyz);" / "abc->xyz=VAL;").

> Now, having tried a couple of approaches to this (as Schemish as possible), I
> am thinking of tring a different one.
> What about making my own C function, let's call it ChXNextEvent that call
> XNextEvent and extracts the info from the XEvent and initializes a Scheme
> native structure or record ? Is that possible ? Is it a good way ? Any
> hints ?

That way you have full control of allocation and make the result
GC-able. You probably want to use `foreign-primitive' for that.
It's a perfectly viable alternative.

Another approach might be SWIG (www.swig.org). The current
cvs version has even better Chicken support, thanks to John Lenz.


cheers,
felix


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to