All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

get-embedded-module-data Function

Summary

Returns a foreign module as a Lisp object suitable for use at run time, possibly via a fasl file.

Package

fli

Signature

get-embedded-module-data filename => data

Arguments
filename
A pathname specifier for a file containing a dynamic foreign module.
Values
data
A Lisp object containing the data of the foreign module.
Description

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.

Notes
  1. 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.
  2. To incorporate the module in a fasl file, 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.
  3. To actually use the code in the module, install-embedded-module must be called at run time with the name of the module (my-embedded-module-name in the examples below).
  4. The module should not have dependencies on other non-standard modules, otherwise install-embedded-module may fail to install it.
Examples

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))
See also

install-embedded-module
get-embedded-module
setup-embedded-module
5.6 Incorporating a foreign module into a LispWorks image


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58