On Sun, 18 Jan 2009, Nikodemus Siivola wrote:
> On Sun, Jan 18, 2009 at 7:23 AM, Daniel Herring <dherring@...> wrote:
>> To paraphrase a question I found on LispForum,
>> Why does
>> (progv '(p q) '(nil t) (eval '(or p q)))
>> issue warnings when
>> (progv '(p q) '(nil t) (eval '(and p q)))
>> does not?
> Neither warns is SB-EXT:*EVALUATOR-MODE* is :INTERPRET. When it is
> :COMPILE, "nontrivial" evaluations are implemented essentailly via
> (funcall (compile nil `(lambda () ,form)))
> . The OR macroexpands into something like
> (LET ((#:G907 P))
> (IF #:G907 #:G907 Q))
> whereas the AND expands into
> (IF P Q NIL)
> Even the simple evaluator is able to deal with the latter without
> first compiling it, but LET forces it to use the compile-then-funcall
> strategy. Since the variables have not been declaimed SPECIAL, the
> compiler warns about unbound variables.
Ok. I had seen the OR macroexpansion, but didn't realize LET was
triggering a compilation. Given your explanation and a night's sleep, the
warnings now make perfect sense.