File: match-split-list.sgm

package info (click to toggle)
docbook-dsssl-doc 1.75-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,672 kB
  • ctags: 8
  • sloc: makefile: 37
file content (66 lines) | stat: -rw-r--r-- 1,613 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<RefEntry id="match-split-list">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename match-split-list.html>

<RefMeta>
  <RefEntryTitle>match-split-list</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>match-split-list</RefName>
  <RefPurpose>Splits a string at a list of targets and returns the resulting list of tokens</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(match-split-list string target-list)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Splits <literal>string</literal> at every target in <literal>target-list</literal> with <literal>(match-split)</literal>,
returning the whole collection of tokens as a list.
</para>
<variablelist>
<varlistentry><term>string</term>
<listitem>
<para>
The string to split.
</para>
</listitem>
</varlistentry>
<varlistentry><term>target-list</term>
<listitem>
<para>
A list of target strings which are the delimters between tokens.
</para>
</listitem>
</varlistentry>
</variablelist>

</RefSect1>

<RefSect1><Title>Author</Title>

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

<ProgramListing>
(define (match-split-list string target-list)
  ;; Splits a string at a list of targets and returns the resulting list of tokens
  (let loop ((result (list string)) (tlist target-list))
    (if (null? tlist)
	result
	(loop (match-split-string-list result (car tlist))
	      (cdr tlist)))))
</ProgramListing>
</RefSect1>

</RefEntry>