ANSI Common Lisp 3 Evaluation and Compilation 3.2 Compilation 3.2.4 Literal Objects in Compiled Files
126.96.36.199 Additional Constraints on Externalizable Objects
If two literal objects appearing in the source code for a single file
the file compiler
are the identical,
the corresponding objects in the compiled code
must also be the identical.
With the exception of symbols and packages, any two
in code being processed by
the file compiler
may be coalesced
if and only if they are similar;
if they are either both symbols or both packages,
they may only be coalesced if and only if they are identical.
Objects containing circular references can
be externalizable objects.
The file compiler is required to preserve eqlness of
substructures within a file.
Preserving eqlness means that subobjects that are
in the source code must
in the corresponding compiled code.
In addition, the following are constraints on the handling of
literal objects by the file compiler:
- array: If an array in the source code is a
simple array, then the corresponding array
in the compiled code will also be a simple array. If
an array in the source code is displaced, has a
fill pointer, or is actually adjustable, the corresponding
array in the compiled code might lack any or all of these
qualities. If an array in the source code has a fill
pointer, then the corresponding array in the compiled
code might be only the size implied by the fill pointer.
- packages: The loader is required to find the
corresponding package object as if by calling
find-package with the package name as an argument.
An error of type package-error is signaled if no
package of that name exists at load time.
- random-state: A constant random state
object cannot be used as the state argument
to the function random because random modifies this data structure.
- structure, standard-object:
Objects of type structure-object and standard-object
may appear in compiled constants if there is an
appropriate make-load-form method defined for that
The file compiler calls make-load-form on any object
that is referenced as a literal object if the object is a
generalized instance of standard-object,
structure-object, condition, or any of a
(possibly empty) implementation-dependent set of other classes.
The file compiler only calls make-load-form once for
any given object within a single file.
- symbol: In order to guarantee that compiled files can be loaded
correctly, users must ensure that the packages referenced in those files
are defined consistently at compile time and load time. Conforming programs
must satisfy the following requirements:
If any of these conditions do not hold, the package in which the loader looks
for the affected symbols is unspecified. Implementations are permitted
to signal an error or to define this behavior.