That’s a lot to take in! No wonder we got it wrong! We’ll take it slow, and look at the arguments.
(condp (* temp time) <
Our pred
was (* temp time)
(a Double
), and our expr was the comparison function <
. For each clause, (pred test-expr expr)
is evaluated, so that would expand to something like
((* temp time) 400 < )
Which evaluates to something like
(123.45 400 <)
But this isn’t a valid Lisp program! It starts with a number, not a function. We should have written (< 400 123.45)
. Our arguments are backwards!
Also the order of clauses was originally incorrect:
300 :soggy
350 :perfect
400 :burned
but gets correctly reversed without any explanation:
400 :burned
350 :perfect
300 :soggy