-append-3</span> length s2 buf idx)
  (<span class="keyword">if</span> (= idx (string-length buf)) buf
      (<span class="keyword">begin</span>
        (string-set! buf idx (string-ref s2 (- idx length)))
        (string-append-3 length s2 buf (1+ idx)))))
(<span class="keyword">define</span> (<span class="function-name">string-append-2</span> s1 s2 buf idx)
  (<span class="keyword">if</span> (= idx (string-length s1))
      (string-append-3 (string-length s1) s2 buf idx)
      (<span class="keyword">begin