[Larceny-users] ffi support for Integer to float
Felix Klock
felixluser at pnkfx.org
Tue Feb 10 15:09:46 EST 2009
Ed (cc'ing larceny-users)-
On Feb 10, 2009, at 2:41 PM, Eduardo Cavazos wrote:
> Felix Klock wrote:
>
>> I use Larceny's define-c-info form to extract
>> the various constants from the header file
>
> One drawback to 'define-c-info' is the dependency on a header file.
> It's
> common for operating systems to have a library file (.so or .dll)
> available but not the corresponding header.
That's absolutely true; the intended development model is that the
developer hooking into the foreign code (and who is supposed to have
these headers installed) is the one using define-c-info; the developer
is then expected to ship compiled .fasl files to the end-client as
part of the complete library interfacing with the foreign code.
This "drawback" is hard to avoid in most cases; foreign libraries that
require references to constants but do not standardize their values
(nor provide procedural interfaces to extract their values) require
someone in the development chain to extract information from the
header file in some manner.
OpenGL falls under the category of a foreign library that standardizes
the values of relevant constants in the interface. OpenGL strikes me
as a library that was designed to be accessed from a large family of
languages (as opposed to just C). So using define-c-info is not
necessary here; I did not mean to imply otherwise.
-Felix
More information about the Larceny-users
mailing list