When loading compiled systems (such as CL-PDF), I would occasionally
get errors about looking for unrelated packages:
The name "ZPB-FOO" does not designate any package.
A similar error can be reproduced pretty easily:
(defun a () 'a)
Then, from the repl, do:
The problem is with the IN-PACKAGE form of a.lisp: the package of the
symbol used in the IN-PACKAGE form lingers in the fasl file, but when
c.lisp deletes the package B and loads a.fasl, the package B can't be
found, even though there are no obvious references to it in the source
of a.lisp itself.
It is pretty easy to avoid this trouble by changing the IN-PACKAGE
macro to stringify its argument as part of macroexpansion; that way,
the string-designator symbol is not written to the fasl, and loading
the fasl doesn't produce confusing missing package errors. (DEFPACKAGE
already stringifies its package name argument early, so it does not
need to be changed.)
Attached is a patch that implements early stringification of the
string-designator given to in-package. As part of the change, this
form will no longer work:
(in-package #.(find-package :some-valid-package))
However, that is not specified to work anyway; the argument is a
string designator, not a package designator.