18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
;;======================================================================
;;======================================================================
;; Process convience utils
;;======================================================================
(use regex directory-utils)
(declare (unit process))
(define (process:conservative-read port)
(let loop ((res ""))
(if (not (eof-object? (peek-char port)))
(loop (conc res (read-char port)))
res)))
|
<
>
>
>
>
>
>
>
>
>
>
|
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
|
;;======================================================================
;;======================================================================
;; Process convience utils
;;======================================================================
(declare (unit process))
(declare (uses common))
(module process
*
(import chicken scheme data-structures extras srfi-13 ports )
(import common)
(use regex directory-utils)
(define (process:conservative-read port)
(let loop ((res ""))
(if (not (eof-object? (peek-char port)))
(loop (conc res (read-char port)))
res)))
|
219
220
221
222
223
224
225
|
(res '()))
(if (eof-object? inl)
(reverse res)
(let ((nums (map string->number
(string-split-fields "\\d+" inl))))
(loop (read-line)
(append res nums))))))))
|
>
|
228
229
230
231
232
233
234
235
|
(res '()))
(if (eof-object? inl)
(reverse res)
(let ((nums (map string->number
(string-split-fields "\\d+" inl))))
(loop (read-line)
(append res nums))))))))
)
|