see docs for (read-line)
On Sat, Aug 20, 2016 at 5:16 PM, Pekka Niiranen
wrote:
> Thank you guys,
>
>
> both functions work. Looks like single function (for/or) could be used
> if the calling side handles #f, #t and a list.
>
> Another issue:
>
> I am planning to
Thank you guys,
both functions work. Looks like single function (for/or) could be used
if the calling side handles #f, #t and a list.
Another issue:
I am planning to support both Unix and Windows, but have not found
a way to define 'return-linefeed as system-wide default (aside using
global
Minor fix: In the first function "read-on-row" you must replace
for/first with for/last.
Gustavo
PS for Pekka: In this case it's better to use for/last and for/or, but
in more complicated cases you can try with for/fold.
On Fri, Aug 19, 2016 at 10:34 AM, WarGrey Gyoudmon Ju
(define (read-on-row *params*)
;; Returns the last line in "myfile" which contains
;; substring "ON", otherwise #f
(call-with-input-file (hash-ref *params* "myfile")
(lambda (inp)
(for/first ([row (in-lines inp 'return-linefeed)]
#:when (string-contains? row
4 matches
Mail list logo