Previous: , Up: iklib libraries   [Index]


6.1.2 Loading host’s foreign libraries

Vicare extends the format of library forms by allowing an optional foreign-library clause:

(library ?library-name
  (foreign-library ?shared-object-id)
  (export  ?export-spec ...)
  (import  ?import-spec ...)
  . ?library-body)

where each ?shared-object-id is a Scheme string object. There can be any number of foreign-library clauses, before the export one.

The clause foreign-library allows us to associate a host’s shared object to the Scheme library, so that, whenever the library is expanded from source code or loaded from a FASL file: the shared object is dynamically loaded with a call to the operating system’s function dlopen(). foreign for details.