fasl loader usage in a delivered image
I have an application that writes out CLOS instances into a source
code file which is subsequently compiled. This is to allow the
instances to be reloaded quickly using the standard LOAD function (of
course you have to define MAKE-LOAD-FORM methods for this to work).
Unfortunately, I don't think that I can get this idiom to work using a
delivered lispworks image because the file compiler has been removed.
It works fine with LWL 4.2.7 when I am running out of the IDE.
Is there any work around so that I can get the desired functionality?
As of right now, I'm using LWL 4.2.7, but I don't think that this is
version specific.
Here is some example code that shows that idiom:
(defun load-web-data (&key (dir *web-dir*)
(name "web-data"))
(load (compile-file-pathname
(make-pathname :defaults dir
:name name)))
(setf *web-id*
(max *web-id*
(1+ (loop for instance in *web-instances*
maximize (web-id instance))))))
(defun dump-web-data (&key (dir *web-dir*)
(name "web-data"))
(let ((cf (make-pathname :defaults dir
:name name
:type "lisp")))
(with-open-file (s cf
:direction :output
:if-exists :supersede
:if-does-not-exist :create)
(dolist (var '(*web-instances*))
(format s "(SETF ~S '#.~S)" var var)))
(compile-file cf :output-file
(compile-file-pathname
(make-pathname :defaults cf :type nil)))))
And here is the contents of one of the files that gets compiled and
then loaded:
(SETF ORG.CL-USER::*WEB-INSTANCES* '#.ORG.CL-USER::*WEB-INSTANCES*)
-russ
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________