4.1 The Foreign Function Interface
foreign-undefined-symbol-names load-foreign-libraries load-foreign-files unintern-foreign-symbolThe function
load-foreign-filesloads foreign language compiled files into the running Lisp environment.
load-foreign-librariesloads selected functions from foreign language library files. Files have
.oextensions, and libraries have
.aextensions by default.
unintern-foreign-symbol makes a foreign symbol inaccessible so that you can reuse its name in newly loaded foreign object code. Thus, you can load a file into Lisp, edit and recompile the file, and then reload a new version of the file into the same image. The function
foreign-undefined-symbol-names lists the foreign symbols that are not associated with foreign code.
Suppose you want to suppress a redefinition of a foreign symbol named
(unintern-foreign-symbol "example") disassociates the symbol from the name
"example" so that loading object files does change not the original foreign symbol.
Normally, all foreign symbols defined in the object file being loaded supersede any definitions that previously existed, just as loading a Lisp file with a definition of a function named
format causes the Common Lisp function
format to be redefined. This ability to dynamically redefine foreign functions carries with it the same benefits and risks that it does for Lisp functions. Redefining a system-level foreign symbol, such as the foreign symbol named
"write", is as dangerous as redefining a system-level Lisp function.
Some foreign symbols have special definitions that cannot be changed without violating the integrity of the Lisp system. The foreign symbols named
"main" are among those symbols that should never be redefined.
Generated with Harlequin WebMaker