[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dumplisp



> >I imagine it would be easy to explicitly code this behavior into
> >the functions which you add to *RESTORE-LISP-FUNCTIONS*.
> >
> But what could the test be?  Any global var that is set would be STORED set
> in the image, hence re-starting the image would not work because the flag

I thought the answer was so obvious I didn't respond...  here's an example:


(defvar *dumped-lisp-time* (get-universal-time))

(defun conditional-lisp-restore-fns ()
  (unless (and (< (- (get-universal-time) *dumped-lisp-time*)
	          3600)  ;; less than an hour old..
               (not (y-or-n-p "Pretty fresh lisp.  Call restore-fns anyway?")))
    (lisp-restore-fns)))

(dumplisp ...)


Assuming the time is set correctly on the machine.
The window could be made smaller, and you could also test for time zone,
"current" time before dumped time, etc.

 -todd