[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
First Class environments in CL ??
Can you obtain a first-class
handle on a lexical environment in CL???
I do not see any operations which return an "environment"
anywhere in CLtL; however, the following discussion is
on page 323 with respect to the evalhook and applyhook feature.
"Furthermore, the 'env' argument is used as the lexical
environment for the operation; 'env' defaults to the null
I see no way to use this other than with the default environment.
Furthermore, if there were "environments" available, then
I'd expect to be able to pass them to EVAL, APPLY, etc.
We should do one of the following:
(1) eliminate the 'env' optional to evalhook/applyhook.
(2) provide a selector which extracts the current lexical environment
and returns it so that it can be stored as any first class object.
I prefer (1) since it makes compilation much easier and more effective.
Finally, to avoid confusion, In CLtL, there is a discussion of the
&environment keyword for macros. It specifically says that this
environment may not be complete, and should only be used with
"macroexpand" and is constructed by "macrolet". This is clearly
not the environment intended for use with evalhook.