[Openmcl-devel] defloadvar and def-ccl-pointers

Gary Byers gb at clozure.com
Fri Nov 26 21:05:43 PST 2004



On Fri, 26 Nov 2004, Alan Ruttenberg wrote:

> When you are going to do a save-application and you need to
> reinitialize a variable when the lisp image starts again. For instance
> you might open a stream to a log file in your defvar. When you save a
> lisp image and exit, that stream gets closed. When the lisp application
> you saved starts again, if you try to write to the closed stream, you
> get an error.  Same deal if you allocate some non-lisp memory structure
> for use with a system call. In these cases use defloadvar and the
> variable initialization forms are run again when the lisp image
> restarts.
>
> -Alan

One thing to note is that DEFLOADVAR should probably have been named
DEFLOADPARAMETER (in that it behaves more like DEFPARAMETER than
DEFVAR: whenever a DEFLOADVAR form is executed - if the containing
file is re-loaded or the form is executed via C-M-X or similar - it
changes the value of the variable.)

When a saved image is started, the initialization forms (functions)
associated with DEF-CCL-POINTERS are executed in the order that they
were first encountered.  (This happens in the initial thread, and
happens before much of anything else happens.)

>
> On Nov 26, 2004, at 3:16 PM, alex crain wrote:
>
> >
> > What is the purpose of DEF-CCL-POINTERS?
> > I can get a handle on what it does, but it's not clear why.
> >
> > Put another way, when and why should I use DEFLOADVAR instead of
> > DEFVAR?
> >
> > :alex
> >
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > http://clozure.com/mailman/listinfo/openmcl-devel
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list