; > (reverse 'cows)
; swoc
; The "Leap of Faith" says that if we are doing (reverse 'cows) then
; (reverse 'ows) will work.  This is one place in the book where I diverge
; from the authors' take.  The reason, I think, that they put "Leap of
; Faith" in the book is that, at the time, they had a lot of trouble
; explaining how recursion works to students.  As the authors themselves
; note, there is no "Leap of Faith" at all.  Recursion works.
;
; So, let's dissect that.  To reverse a word, we need to do two things:
; 1. Find an appropriate base case.  Typically, this means to find the
;    smallest relevant value.  What is it for reverse?
; 2. For things that are not the smallest possible, process one piece of
;    the thing and combine the result with a recursive call on the rest
;    of the thing.  Process one piece of that and do another recursive
;    call on the rest of that.  And so on.  Until there are no more pieces
;    to process.  (See (1), above.)
;
; * COMBINING
;   In this specific case, "word"
; * PROCESSING A PIECE OF THE DATA (BUT NOT ALL)
;   Typically, this means use "first"
; * RECURSIVELY PROCESSING THE REST OF THE DATA
;   Typically, this means "bf"

(define (reverse wd)
  (cond ((empty? wd) wd)
        (else (word (reverse (bf wd)) (first wd)))))