4.1 The Foreign Function Interface
def-foreign-functiondefines 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.
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.
*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 use
def-foreign-callable to create new functions:
safetyoptimization 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