Next: , Previous: fasl format, Up: fasl


E.2 FASL files API

The following bindings are exported by the libraries (ikarus) and (vicare).

— Function: fasl-write obj port
— Function: fasl-write obj port libraries

Serialise obj to the binary output port port prefixing it with the FASL file header. If libraries is present: it must be a list of strings representing foreign shared libraries to be loaded whenever the FASL file is loaded, fasl foreign for details.

— Function: fasl-read port

Read and return a serialised object from the binary input port.

— Parameter: fasl-directory

Holds a string representing the top directory under which FASL files are stored when libraries are compiled. The default value is determined as follows:

  1. Check the value of the system environment variable VICARE_FASL_DIRECTORY: if set and its value exists as pathname, the value is selected. Else move to the next step.
  2. Acquire the value of the system environment variable HOME: if set and its value exists as pathname, compose a directory pathname by appending to the value the string:
                   /.vicare/precompiled
    

    Else move to the next step.

  3. Set the parameter to the empty string. This means that a library with pathname: /usr/local/scheme/vicare/posix.sls will be compiled to /usr/local/scheme/vicare/posix.sls.vicare-32bit-fasl

New values for this parameter must be Scheme strings representing existing pathnames. The pathnames are normalised to their real pathname, removing symbolic links and useless .. components.

The default value of this parameter can be overridden by the command line option --fasl-directory.

— Function: fasl-path filename

Given a source file name return the associated full FASL file name using the current value of fasl-directory. Return false if fasl-directory is unset (which should never happen). It is an error if the file filename does not exist.

— Parameter: fasl-search-path

Holds a list of strings representing directory pathnames. This search path is used to locate FASL files when loading precompiled libraries. The default value is determined as follows:

  1. Check the value of the system environment variable VICARE_FASL_PATH: if set the value is selected. Else move to the next step.
  2. Acquire the value of the system environment variable HOME: if set and its value exists as pathname, compose a directory pathname by appending to the value the string:
                   /.vicare/precompiled
    

    the result is put into a list and becomes the default value.

Additional directories can be prepended to the search path with the command line option --fasl-path. If a FASL target directory is selected with the option --fasl-directory: the selected directory is always prepended to the FASL search path.