<span class="paren1">(<span class="default">use irregex</span>)</span> <span class="comment">; irregex, the regular expression library, is one of the
</span>     	      <span class="comment">; libraries included with CHICKEN.
</span>
<span class="paren1">(<span class="default"><i><span class="symbol">define</span></i> <span class="paren2">(<span class="default">process-line line re rplc</span>)</span> 
  <span class="paren2">(<span class="default">irregex-replace/all re line rplc</span>)</span></span>)</span>

<span class="paren1">(<span class="default"><i><span class="symbol">define</span></i> <span class="paren2">(<span class="default">quickrep re #!key rplc</span>)</span>
  <span class="paren2">(<span class="default"><i><span class="symbol">let</span></i> <span class="paren3">(<span class="default"><span class="paren4">(<span class="default">line <span class="paren5">(<span class="default">read-line</span>)</span></span>)</span></span>)</span>
    <span class="paren3">(<span class="default"><i><span class="symbol">if</span></i> <span class="paren4">(<span class="default">not <span class="paren5">(<span class="default">eof-object? line</span>)</span></span>)</span>
        <span class="paren4">(<span class="default">begin 
          <span class="paren5">(<span class="default">display <span class="paren6">(<span class="default">process-line line re rplc</span>)</span></span>)</span>
          <span class="paren5">(<span class="default">newline</span>)</span>
          <span class="paren5">(<span class="default">quickrep re rplc</span>)</span></span>)</span></span>)</span></span>)</span></span>)</span>

<span class="comment">;;; Does a lousy job of error checking!
</span><span class="paren1">(<span class="default"><i><span class="symbol">define</span></i> <span class="paren2">(<span class="default">main args</span>)</span>
  <span class="paren2">(<span class="default">quickrep <span class="paren3">(<span class="default">irregex <span class="paren4">(<span class="default">car args</span>)</span></span>)</span> <span class="keyword">rplc:</span> <span class="paren3">(<span class="default">cadr args</span>)</span></span>)</span></span>)</span>
<span class="paren1">(<span class="default"><i><span class="symbol">define</span></i> <span class="paren2">(<span class="default">alternative-main args</span>)</span>
  <span class="paren2">(<span class="default">quickrep <span class="paren3">(<span class="default">irregex <span class="paren4">(<span class="default">car args</span>)</span></span>)</span> <span class="keyword">#:rplc</span> <span class="paren3">(<span class="default">cadr args</span>)</span></span>)</span></span>)</span>