source: project/wiki/eggref/5/scan-input-lines @ 36727

Last change on this file since 36727 was 33261, checked in by evhan, 4 years ago

wiki/scan-input-lines: Add documentation

File size: 2.3 KB
Line 
1[[tags: egg]]
2
3== scan-input-lines
4
5[[toc:]]
6
7{{scan-input-lines}} provides a single procedure of the same name that's
8useful for scanning through lines from an input port.
9
10==== scan-input-lines
11
12<procedure>(scan-input-lines REGEXP [PORT])</procedure>
13
14Reads lines from {{PORT}} (defaults to the result of {{(current-input-port)}})
15using {{read-line}} and returns the result of {{(irregex-search REGEXP LINE)}},
16if the match succeeds. If no match could be found, {{#f}} is returned.
17
18{{REGEXP}} may also be a procedure of one argument which is called for each
19input line and should return a non-false value on success, which will then
20be the result of the call to {{scan-input-lines}}.
21
22=== Author
23
24The CHICKEN Team
25
26=== License
27
28  Copyright (c) 2016, The CHICKEN Team
29  All rights reserved.
30 
31  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
32  conditions are met:
33 
34    Redistributions of source code must retain the above copyright notice, this list of conditions and the following
35      disclaimer.
36    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
37      disclaimer in the documentation and/or other materials provided with the distribution.
38    Neither the name of the author nor the names of its contributors may be used to endorse or promote
39      products derived from this software without specific prior written permission.
40 
41  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
42  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
43  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
44  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
46  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
48  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49  POSSIBILITY OF SUCH DAMAGE.
50
51=== Version History
52
53; 1.0 : Taken from the utils unit and released as an egg for CHICKEN 5.
Note: See TracBrowser for help on using the repository browser.