[Openmcl-devel] save-application and :toplevel-function

Dave Baum Dave.Baum at motorola.com
Wed Sep 7 14:46:27 PDT 2005


I am a little confused about how save-application works with a  
toplevel-function.  I assumed that the toplevel-function would be  
called, and that when it returned the process would end.  However, it  
appears that the toplevel-function gets called repeatedly in an  
infinite loop.  Is this by design, or is there something wrong with  
how I am generating the image?  Here's some code...

(defun my-topfunc ()
   (format t "Hello, world~%"))

(save-application "my-app" :toplevel-function #'my-topfunc :prepend- 
kernel t :compress t)

Assuming that calling toplevel-function repeatedly is by design, then  
what is the best way to have something run once and exit?  Just  
calling "quit" doesn't seem to be enough since standard output  
remains unflushed.  The following works, but I'm concerned that  
perhaps I'm missing other cleanup.

(defun my-topfunc ()
   (format t "Hello, world~%")
   (finish-output *standard-output*)
   (quit))

Is there a function other than quit that should be used for orderly  
termination of the lisp environment?

Thanks,
Dave





More information about the Openmcl-devel mailing list