"Tobias C. Rittweiler" <tcr@...> writes:
>  Neither SBCL nor CMUCL seem to be able to recognize that
> (READ-FROM-STRING <CONSTANT>)
> is a constant expression which can me reduced on compile
That's probably because it isn't, for several reasons.
Firstly, anything that's preceded by the read-eval #. macro must be
evaulated at run-time, not compile-time.
Secondly, the bindings for the readtable, *read-eval*, *package*, and
the like, must be those prevailing at run-time, not compile-time.
Thirdly, interning is a side effect, and should not happen at
compile-time; if a token with an explicit package qualifier is inside
the string constant, the package need not exist at compile time.
As against the difficulty of solving these problems, say by optimistic
evaluation guarded by assertions, one must measure the likely benefits
for real code, which are approximately zero, unless I miss my guess.