the little racketeer – 05

The last page of number games gives you this question:

The text then provides two examples of how to write this procedure, both of which are baffling to me:

(define one?
  (λ (n)
    (cond
      ((zero? n) #f)
      (else (zero? (sub1 n))))))
(define one?
  (λ (n)
    (cond
      (else (= n 1)))))

This seems unrealistic, or maybe my mind just doesn’t work this way. While an “answer” procedure earlier was “almost right” to introduce a logical idea, I don’t see how I would ever have thought to do this in this way. They follow this up with the obvious answer:

(define one?
  (λ (n) (= n 1)))

Perhaps the reasoning is that all previous example procedures used cond, and it’s use is implied in the Commandments introduced so far. This is not quite true, as the extra procedures (atom?, add1, and sub1) needed to complete these exercises do not use cond. I am just not sure that there is much value to that exercise. If I edited this, I’d recommend prompting to write the procedure without cond.