From: Bruno Haible <bruno@cl...> - 2004-12-23 15:07:09
> > +; FIXME: This is still not correct: The form can contain macros or THE.
> how about MACROEXPAND before SUBLIS-IN-FORM?
Should not be done because the macroexpansion of PUSH, POP etc. shall be
suitable for both the evaluation and the compilation environment. If we
use MACROEXPAND in SUBST-IN-FORM, then it ignores the compiler-macros and
is not suitable for the compilation environment. If we use the compiler-macros,
OTOH, the result is not suitable for the evaluation environment.
> (actually, we probably need EXPAND-FORM for the correct situation...)
No, this wouldn't help here.
What would be needed, is a function which returns all subforms of the
given form. You can also say, all for-value positions. Example:
(all-subforms '(with-open-stream (s (the stream (open fn))) (output s)))
( (with-open-stream (s (the stream (open fn))) (output s))
(the stream (open fn))
Such a function would also be useful for good pretty-printing, and for
syntax coloring in an editor or debugger.