4.1 The Foreign Function Interface

4.1.7 Passing foreign and Lisp data types

The figures in this section list the Lisp data types that can be passed to foreign functions and the foreign data types that can be passed to Lisp. You define foreign functions that can be called from Lisp with the macrodef-foreign-function; the macro def-foreign-callable allows you to call a Lisp function from a function defined in another language.

You should consider the following information when passing data types to foreign functions from Lisp and vice versa:

To pass any other type of string to a C function, you must ensure that the string ends with a null byte and declare it to be of typec-string-type.

(subtypep (array-element-type string) 'string-char) 
The length of a string is always passed to FORTRAN functions.

4.1.7.1 - Passing C data to Lisp functions
4.1.7.2 - Passing FORTRAN data to Lisp functions
4.1.7.3 - Passing Pascal data to Lisp functions
4.1.7.4 - Passing Lisp data to C functions
4.1.7.5 - Passing Lisp data to FORTRAN functions
4.1.7.6 - Passing Lisp data to Pascal functions

The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker