I have dumped a lisp image of my application in CMUCL. When I restart the
image, I want it to first do some initalization (fork off a server, and
read configuration files), before it starts a read-evel-print loop. The
application runs in screen on Solaris.
I can't use :init-function to rin this initailization function, since the
program ends if the init function ends, and that is not what I want. I can
of cause call a function like the following (naive) repl:
(defun naive-repl ()
(loop
(format t "~%--> ")
(print (eval (read)))))
The problem with this naive repl is that it don't catch errors. If a
condition occurs (so that cmucl jumps into the debugger), the program
will never more enter the naive-repl. Is there a better way to enter
the repl after image restart and initialization?
--
Gisle S�lensminde
Computational biology unit, University of Bergen, Norway
Email: ·····@cbu.uib.no
Gisle S�lensminde <·····@apal.ii.uib.no> writes:
> I have dumped a lisp image of my application in CMUCL. When I restart the
> image, I want it to first do some initalization (fork off a server, and
> read configuration files), before it starts a read-evel-print loop. The
> application runs in screen on Solaris.
>
> I can't use :init-function to rin this initailization function, since the
> program ends if the init function ends, and that is not what I want. I can
> of cause call a function like the following (naive) repl:
The easiest thing to do is to end your init-function with a call to
CL::%TOP-LEVEL, the built-in top-level.
--
/|_ .-----------------------.
,' .\ / | No to Imperialist war |
,--' _,' | Wage class war! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
>>>>> "gs" == Gisle S�lensminde <·····@apal.ii.uib.no> writes:
>>>>> "tfb" == Thomas F Burdick <···@famine.OCF.Berkeley.EDU> writes:
gs> I have dumped a lisp image of my application in CMUCL. When I restart the
gs> image, I want it to first do some initalization (fork off a server, and
gs> read configuration files), before it starts a read-evel-print loop. The
gs> application runs in screen on Solaris.
tfb> The easiest thing to do is to end your init-function with a call to
tfb> CL::%TOP-LEVEL, the built-in top-level.
that should be LISP::%TOP-LEVEL ; the next release of CMUCL will have
disjoint CL and LISP packages.
A better solution than using unexported functions would be to hook your
initialization function onto EXT:*AFTER-SAVE-INITIALIZATIONS*:
"This is a list of functions which are called when a saved core image starts
up. The system itself should be initialized at this point, but applications
might not be."
--
Eric Marsden <URL:http://www.laas.fr/~emarsden/>
In article <···············@melbourne.laas.fr>, Eric Marsden wrote:
> A better solution than using unexported functions would be to hook your
> initialization function onto EXT:*AFTER-SAVE-INITIALIZATIONS*:
>
> "This is a list of functions which are called when a saved core image starts
> up. The system itself should be initialized at this point, but applications
> might not be."
>
This was exactly what I wanted. Thanks a lot.
--
--
Gisle S�lensminde
Computational biology unit, University of Bergen, Norway
Email: ·····@cbu.uib.no