[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Function constants
I believe that there are some scenarios in which EVAL and COMPILE-FILE
have the same behavior. My question (it's actually a question, not a
disguised contention) is whether these scenarios can be captured with
a simple description, and if so whether that description is
unrestrictive enough.
For example, the description I propose is:
1. A well-formed compilation unit has all type and macro definitions
first, then all function definitions, and then all executable expressions.
2. You must use a fresh Lisp when compile-filing, and you cannot
invoke load or anything but trivial (or *no*) EVAL-WHEN's.
3. You must load a compile-filed file into a fresh copy of the same Lisp.
If you do these, the semantics of EVAL and compile-file on that compilation
unit is the same (?).
Now, once you've described this very safe situation to the user, you
can *go* *on* to say what other restrictions would apply if you relaxed
these conditions - what if you load, what if you do have hairy EVAL-WHEN's.
The idea is that some users will want to know how to construct totally
reliable compilable files without having to learn obscure rules. We
can express these obscure rules, but I also want to see a simple
prescription that does not limit the semantics of Common Lisp.
If the obscure rules are not too obscure, then it is probably best to
just go with them, but I thinkwe currently skate close to the edge with
the obscure rules (this is a compliment, also, to Sandra: we could easily have
gone off the deep end, but didn't.)
-rpg-