*restart-app-function*

The value of this variable should be a function name or function
object (suitable as the first argument to funcall) or nil. The
function should take no arguments. It is called at the end of the
startup procedure instead of a standard Lisp listener being
started. This function is designed to provide its own top-level (in
place of a Lisp listener). The function should not return. The
behavior if it does return is undefined.

Warning: the functions build-lisp-image and generate-application both accept a
:restart-app-function keyword argument whose value
defaults to the value of this variable. However, the only valid values
for that argument are a symbol or a list (typically a lambda expression
defining an anonymous function). If the value of this variable is a
function object, and the :restart-app-function
argument is not specified, the call to build-lisp-image or generate-application will fail. Thus, this
will fail:

The variable is designed for applications. Users and programmers
wanting to dump Lisp images for later use will not typically set this
variable (instead, *restart-init-function*, allows for
initializations prior to the Lisp listener starting). Programmers who
want to start a Lisp listener themselves (perhaps providing a choice
between the application top-level and a standard listener) from within
*restart-app-function*
should see the description of start-interactive-top-level.