title: Use of local in Racket/Scheme
body: <p>In Exercise 18.1.12 from <a href="http://htdp.org/2003-09-26/Book/curriculum-Z-H-1.html#node_toc_node_sec_Temp_106" rel="noreferrer">htdp</a>, I've re-written the maxi function using "local". </p>
  
  <pre><code>;; maxi : non-empty-lon  -&gt;  number
  ;; to determine the largest number on alon
  (define (maxi alon)
    (cond
      [(empty? (rest alon)) (first alon)]
      [else (local ((define m (maxi (rest alon))))
              (cond
                [(&gt; (first alon) m) (first alon)]
                [(&gt; m (first (rest alon))) m]
                [else (first (rest alon))]))]))
  </code></pre>
  
  <p>I'm not sure why I would do this in "real life" as it seems the book's version is shorter, clearer and probably faster as well.</p>
  
  <pre><code>(define (maxi alon)
    (cond
      [(empty? (rest alon)) (first alon)]
      [else (cond
          [(&gt; (first alon) (maxi (rest alon))) (first alon)]
          [else (maxi (rest alon))])]))
  </code></pre>
  
  <p>Was it meant to be a purely pedagogical exercise? Could an experienced Schemer comment on the code above? Thank you.</p>