All Manuals > LispWorks User Guide and Reference Manual > 32 The HCL Package

NextPrevUpTopContentsIndex

with-output-to-fasl-file

Function
Summary

Sends output to a fasl file on disk.

Package

hcl

Signature

with-output-to-fasl-file ( stream pathname &rest options ) &body body => nil

Arguments

stream

Stream to be bound to the fasl file to be created.

pathname

Name of the fasl file to be created.

body

Forms, some of which may be dumped.

Values

Returns nil .

Description

with-output-to-fasl-file is used in conjunction with dump-form. The body forms are executed, and during the execution, dump-form may be called to dump selected forms. Dumped forms are evaluated if the file pathname is later loaded by load-data-file.

To be able to load the output file, it must have a file type that LispWorks recognizes as a binary file. You can do it by:

If the file pathname already exists, it is superseded.

A fasl file created using with-output-to-fasl-file must be loaded only by load-data-file, and not by load .

Example
CL-USER 12 > (with-output-to-fasl-file (s "/tmp/foo.fasl")
               (dump-form '(print 'hello) s)) 
NIL
 
CL-USER 13 > (let ((sys:*binary-file-type* "fasl")) 
               (sys:load-data-file "/tmp/foo.fasl"))
; Loading fasl file "/tmp/foo.fasl"
 
HELLO 
#P"/tmp/foo.fasl"
See also

dump-form
dump-forms-to-file
load-data-file
*binary-file-type*
*binary-file-types*


LispWorks User Guide and Reference Manual - 21 Dec 2011

NextPrevUpTopContentsIndex