<RefEntry id="repl-substring-listX3F">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename repl-substring-list-p.html>

<RefMeta>
  <RefEntryTitle>repl-substring-list?</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>repl-substring-list?</RefName>
  <RefPurpose>Perform repl-substring? with a list of target/replacement pairs</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(repl-substring-list? string replace-list pos)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Returns <literal>#t</literal> if any target in <literal>replace-list</literal> occurs at <literal>pos</literal> in <literal>string</literal>.
</para>
<variablelist>
<varlistentry><term><literal>string</literal></term>
<listitem>
<para>
The string in which replacement should be tested.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>replace-list</literal></term>
<listitem>
<para>
A list of target/replacement pairs.  This list is just a list of
strings, treated as pairs.  For example, <literal>("was" "x" "is" "y")</literal>.
In this example, <literal>was</literal> may be replaced by <literal>x</literal> and <literal>is</literal> may be
replaced by <literal>y</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry><term><literal>pos</literal></term>
<listitem>
<para>
The location within <literal>string</literal> where the test will occur.
</para>
</listitem>
</varlistentry>
</variablelist>

</RefSect1>

<RefSect1><Title>Example</Title>

<para>
<literal>(repl-substring-list? "this is it" ("was" "x" "is" "y") 2)</literal>
returns <literal>#t</literal>: "is" could be replaced by "y".
</para>


</RefSect1>

<RefSect1><Title>Author</Title>

<para>
Norman Walsh, &lt;ndw@nwalsh.com&gt;
</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>

<ProgramListing>
(define (repl-substring-list? string replace-list pos)
  ;; Perform repl-substring? with a list of target/replacement pairs
  (let loop ((list replace-list))
    (let ((target (car list))
	  (repl   (car (cdr list)))
	  (rest   (cdr (cdr list))))
      (if (repl-substring? string target pos)
	  #t
	  (if (null? rest)
	      #f
	      (loop rest))))))
</ProgramListing>
</RefSect1>

</RefEntry>
