[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
disassemble and compile questions
I'm in need of enlightenment. The answers to the following two
questions are not obvious from my readings of the book.
1. If f is an interpreted function, does (disassemble 'f)
cause f to become a compiled function?
2. What is the appropriate way to compile a function object
that is not compiled, not a lambda-expression and not the
function definition for a symbol? Consider the "lexical
closure" example in section 2.13 of CLtL.
More on 1:
According to CLtl section 25.1, in the definition of disassemble,
"The argument should be either a function object, a lambda-expression,
or a symbol with a function definition. If the relevent function is
not a compiled function, it is first compiled. ... This is primarily
useful for debugging the compiler ... ."
Side-effecting the function cell by disassembling does not seem like
a result I would desire, especially when debugging the compiler.
Is (compile 'symbol) or (compile nil (symbol-function 'symbol)) the
intended means of compilation?
More on 2:
The definition of compile states that it will only handle lambda-
expressions: "If definition is supplied, it should be a lambda-expression,
the interpreted function to be compiled. If it is not supplied, then
name should be a symbol with a definition that is a lambda-expression;
... ." Section 2.13 states that lists other than lambda expessions
may, in certain implementations, serve as functions. Should the
definition of compile include such cases? I hope so.