4.1 The Foreign Function Interface
The macrodef-foreign-callable
def-foreign-function
*lisp-symbol-to-foreign-string-method*
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:
safety
optimization class a value of 3, the type declarations are ignored; the types of all arguments are specifically checked. Running interpreted or compiled code at this safety level is slower than running code at a lower safety level.Generated with Harlequin WebMaker