Comment 3 for bug 504121

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 504121] Re: compile error when "every" applies lambda expression

Roman Marynchak <email address hidden> writes:

> Reduced to
>
> (defun all-caps-no-vowels-fix (S)
> (and (some #'upper-case-p S)
> (every #'(lambda (char) (upper-case-p char))
> S)))
>
> The weirdness is that it works when replacing AND with OR.
>
> The bug itself is that UPPER-CASE-P entry is not dumped:
>
> Does anybody have an idea why AND -> OR replacement hides the bug?

Well, your ALL-CAPS-NO-VOWELS function seems to be an REALLY-ALL-CAPS
function (you're calling upper-case-p twice)

Speculating, probably the OR variant is sufficiently smart to know that
if not (some #'upper-case-p s) -- the only case where the second
condition is checked -- then (every #'upper-case-p s) cannot possibly be
true.

Christophe