[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Source code non-access (Re: defstruct request)
If it is true that definitions cannot be programmatically reconstructed
in Common Lisp, was this an explicit committee decision?
It has never been the case in the Maclisp world that all of the
information is the source program is preserved at runtime, especially in
the case where the code you load is compiled. Implementations do
various things to make the original information available for debugging
purposes, but this has always been considered an environment issue -- a
debugging aid, mostly -- and not a part of the language proper. For
example, some implementations "macro-memoize" (replace a macro call with
its expansion) in the interpreter, and many of these expanders keep
track of the original macro form so that the expansion can be undone if
the macro is altered at runtime; some keep track of what forms were
created by character macros in the reader so that the printer can
perform the inverse transform; some annotate each compiled function with
a pointer back into the proper place in the original source file. But
the language spec does not require any of this.
The tradition in Interlisp is different, since the runtime image is
considered to be the primary form of a program with which the user
interacts; in Maclisp, you go back to the source file to make changes,
usually using some Emacs-like editor. Therefore, in Interlisp, all of
the information about a program must be included in or accessible from
the runtime program. The Common Lisp design tries to accommodate this
style of interaction, but not to require it.
I don't think that it was ever an explicit decision of the design group
that the language would not require that all information in the source
be preserved at runtime; it was simply an assumption that was never
challenged. The question did come up whether we should require an
Interlisp-style or an Emacs-style editing environment, and it was clear
that Common Lisp would not be accepted unless it accommodated both
styles, but required neither.
-- Scott