Returns a foreign module as a Lisp object suitable for use at run time, possibly via a fasl file.
The function
get-embedded-module-data
returns the foreign module in
filename
as a Lisp object suitable as argument to setup-embedded-module, but also externalizable, that is the compiler can put it in a fasl file.
get-embedded-module-data
is useful when you need to incorporate a foreign dynamic module in a fasl file, which is itself useful when the fasl is loaded on the run time computer. In the usual situation when the fasl is loaded on the same computer where it is compiled, get-embedded-module is more convenient, and replaces both
get-embedded-module-data
and setup-embedded-module.
get-embedded-module-data
must be called at compile time, which is typically done either by doing it at read time with
#.
or using a macro. The result is then used as argument to setup-embedded-module at load time. Examples of both approaches are shown below.
my-embedded-module-name
in the examples below).
Calling
get-embedded-module-data
at read time with
#.
:
(setup-embedded-module 'my-embedded-module-name
#.(get-embedded-module-data
(my-locate-the-foreign-module)))
Calling
get-embedded-module-data
via a macro. Note that there is no backquote or quote, so the code is executed by by the compiler:
(defmacro my-get-embedded-module-data ()
(let ((pathname (my-locate-the-foreign-module)))
(get-embedded-module-data pathname))
(setup-embedded-module 'my-embedded-module-name
(my-get-embedded-module-data))
install-embedded-module
get-embedded-module
setup-embedded-module
Incorporating a foreign module into a LispWorks image
LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011