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.

Supply an appropriate fasl extension in pathname . A simple way to achieve this is by calling compile-file-pathname . A complete list of fasl extensions for supported platforms may be found in compile-file.

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

 


LispWorks Reference Manual - 12 Mar 2008

NextPrevUpTopContentsIndex