This specifies the variables that are initially bound in a Lisp process when that process is created. This variable is an association list of symbols and initial value forms. The initial value forms are processed by a simple evaluation that handles symbols and function call forms, but not special operators.As a special case, if the value form is the same as the symbol and that symbol is unbound, then the symbol will be unbound in the new process.
When process-run-function is called, it performs the evaluation in the dynamic environment of the call. It is therefore possible to bind
*process-initial-bindings* dynamically around the call, as shown in the examples below, and that is the preferred way of using
*process-initial-bindings* (rather than setting the global value).
The initial value forms in
*process-initial-bindings* are also evaluated in outer calls on foreign threads, which are threads that were made by foreign code rather than by Lisp. See Foreign callbacks on threads not created by Lisp for discussion. Note that in this case. the evaluation occurs in a dynamic environment where the variables in
*process-initial-bindings* are not bound yet. That is different from calls to process-run-function, where all the variables that were in
*process-initial-bindings* at the time that the calling process was created are already bound.
Changing the global value of
*process-initial-bindings* affects all new processes in the system, including processes that will be associated with foreign threads. Unless that is what you want, you should not set the global value. When you do set it, you should take care to avoid errors.
Errors in the evaluation are signaled in the standard way when they occur due to to process-run-function. When LispWorks creates processes for its own use, it just ignores such errors and binds the corresponding variable to
nil. When the evaluation is for a foreign thread, the error is signaled as usual, wrapped with a restart that allows you to use
nil as the value.
(defvar *binding-1* 10)
LispWorks User Guide and Reference Manual - 20 Sep 2017