Next Prev Up Top Contents Index

dump-forms-to-file

Function
Summary

Dumps specified forms to a fasl file.

Package

hcl

Signature

dump-forms-to-file pathname forms => nil

Arguments

pathname

Name of the fasl file to be created.

forms

Forms to be dumped.

Values

Returns nil .

Description

dump-forms-to-file dumps specified forms to a fasl file. Use the Common Lisp functions make-load-form and make-load-form-saving-slots to control the dumping of forms.

The best way to specify the file type of the output file is to use compile-file-pathname as in the example below. The file types currently used by LispWorks for fasl files are listed in with-output-to-fasl-file.

Example
(defclass my-class () ((a :initarg :a :accessor my-a)))
(defmethod make-load-form ((self my-class) &optional environment)
  (declare (ignore environment))
  `(make-instance ',(class-name (class-of self))
                  :a ',(my-a self)))
(setq *my-instance* (make-instance 'my-class :a 42))
(dump-forms-to-file
  (compile-file-pathname "my-instance")
 (list `(setq *my-instance* ,*my-instance*)))

In another session, with the same definition of my-class , loading the file "my-instance" will create an equivalent instance of my-class .

See also

with-output-to-fasl-file


LispWorks Reference Manual (Windows version) - 14 Dec 2001

Next Prev Up Top Contents Index