4.1 The Foreign Function Interface

4.1.1 Defining and calling foreign functions

The following constructs allow you to define functions that can be used in the Foreign Function Interface:


The macro def-foreign-function defines a Lisp function that calls a foreign function. Lisp arguments are converted to the appropriate foreign data type before the foreign function call The value returned by the foreign function is then converted to a Lisp data type.

The macro def-foreign-callable defines a Lisp function that can be called from foreign code. The foreign arguments are converted to Lisp data types; the value returned by the function is coerced to a foreign data type and returned to the caller.

The variable*lisp-symbol-to-foreign-string-method* names a function that can be invoked to compute a name for a foreign function not named in its original definition.

You should consider the following information about declarations when you usedef-foreign-function anddef-foreign-callable to create new functions: - Avoiding SIGALRM signals - Examples

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker