[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
load-time-eval
I think someone has mentioned this before, but Common Lisp needs a
load-time-eval or deferred-constant facility.
load-time-eval (form) [macro]
When evaluated (by the evaluator) simply evaluates form and returns its
result.
When a use of load-time-eval is compiled (by compile-file) arranges for
form to be evaluated at load-time. The call to load-time-eval when
evaluated will then return the result of having evaulated the form
When compiled to core (by compile-file) simply evaluates form at compile
time and arranges for the call to load-time-eval to return the result of
evaluting form.
It seems like it should be easy for implementors to implement this using
the mechanism they already have for #,.
Or we could have a deferred constant facility like the one in Interlisp.
Or we could have both.
We need something though, because the fact that you can't use #, in a
macro and have it do "what you want" makes #, of limited usefulness.