[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C error-returning functions and Guile exceptions
From: |
Greg Troxel |
Subject: |
Re: C error-returning functions and Guile exceptions |
Date: |
Fri, 11 Mar 2005 10:11:42 -0500 |
1. Write a C function that wraps `read_stuff ()', checks the
error code returned and calls `scm_throw ()' if necessary;
It would be cool to extend g-wrap to be able to do this automatically.
There is already support (I think) for multiple return values, so one
would need to add a return type 'errno' that is ignored if 0, and
causes a throw if not.
2. Find a way to make the BUFFER/READ pair translate into a return
value of the Scheme function.
One could have vector objects, but recvfrom! already has similar
behavior, so I'd be tempted to act like that. Strings are really
arrays, since they have lengths and aren't NULL terminated.