load-foreign-library — Loads a foreign library.


     load-foreign-library filename &key module supporting-libraries force-load => success


A string or pathname specifying the library location in the filesystem. At least one implementation (Lispworks) can not accept a logical pathname. If this parameter denotes a pathname without a directory component then most of the supported Lisp implementations will be able to find the library themselves if it is located in one of the standard locations as defined by the underlying operating system.


A string designating the name of the module to apply to functions in this library. (Required for Lispworks)


A list of strings naming the libraries required to link the foreign library. (Required by CMUCL)


Forces the loading of the library if it has been previously loaded.


A boolean flag, T if the library was able to be loaded successfully or if the library has been previously loaded, otherwise NIL.


Loads a foreign library. Applies a module name to functions within the library. Ensures that a library is only loaded once during a session. A library can be reloaded by using the :force-load key.


(load-foreign-library #p"/usr/lib/" 
                      :module "mysql" 
                     :supporting-libraries '("c"))
=> T

Side Effects

Loads the foreign code into the Lisp system.

Affected by

Ability to load the file.

Exceptional Situations