Mark Fredrickson scripsit: > 1. Many of the GEOS functions return 'char', even though the actual > data should be a bool. Is there a way to tell easyffi to treat these > characters as #t/#f? I'm thinking there might be a __declare() for it, > but I didn't see anything that made immediate sense to me. > > 2. Several of the functions return ints to represent success, errors, > and take a "return" argument by reference. Is there a best practice > for dealing with these kinds of functions? Here's an example if I'm > not being clear (the goal is to compute the length of a "geometry" > e.g. a line):
The general answer in both cases is to wrap the raw C function in a Scheme function that provides a more sensible interface. That takes care of #1. As for #2, Scheme can return multiple values, unlike C, so you can pass back both the status and the return argument. -- Here lies the Christian, John Cowan judge, and poet Peter, http://www.ccil.org/~cowan Who broke the laws of God [EMAIL PROTECTED] and man and metre. _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users