Merge remote branch 'origin'

This commit is contained in:
Mike Sperber 2010-05-20 20:04:37 +02:00
commit 15ea740fa3
4 changed files with 5 additions and 4 deletions

View File

@ -77,7 +77,7 @@
(define lines (read-chunks f read-line (lambda (x) x))) (define lines (read-chunks f read-line (lambda (x) x)))
(foldl (lambda (f r) (foldl (lambda (f r)
(define fst (filter (compose not (curry string=? "")) (split f))) (define fst (filter (compose not (curry string=? "")) (split f)))
(if (empty? fst) r (combine fst r))) (combine fst r))
'() lines)) '() lines))
(def-reader (read-csv-file f) (def-reader (read-csv-file f)
@ -93,10 +93,9 @@
(define-syntax (simulate-file stx) (define-syntax (simulate-file stx)
(syntax-case stx () (syntax-case stx ()
[(simulate-file) [(simulate-file)
(raise-syntax-error #f "expects a reader function as first argument" stx)] (raise-syntax-error #f "expects at least one sub-expression" stx)]
[(simulate-file reader str ...) #'(simulate-file/proc (f2h reader) str ...)])) [(simulate-file reader str ...) #'(simulate-file/proc (f2h reader) str ...)]))
(define (simulate-file/proc reader . los) (define (simulate-file/proc reader . los)
(define _1 (check-proc "simulate-file" reader 1 "reader" "one argument")) (define _1 (check-proc "simulate-file" reader 1 "reader" "one argument"))
(define _2 (define _2

View File

@ -111,7 +111,7 @@ by @racket[kind], which must be one of the following:
@item{@indexed-racket['exec-file] --- the path of the Racket @item{@indexed-racket['exec-file] --- the path of the Racket
executable as provided by the operating system for the current executable as provided by the operating system for the current
invocation. invocation. For some operating systems, the path can be relative.
@margin-note{For GRacket, the executable path is the name of a GRacket @margin-note{For GRacket, the executable path is the name of a GRacket
executable.}} executable.}}

View File

@ -93,6 +93,7 @@ a part of the separator that surrounds the word @scheme["good"].
] ]
The results is similar to the one that @scheme[read-words] produces, The results is similar to the one that @scheme[read-words] produces,
except that the organization of the file into lines is preserved. except that the organization of the file into lines is preserved.
In particular, the empty third line is represented as an empty list of words.
} }
@item{@reading[read-csv-file (listof (listof any/c))]{a list of lists of comma-separated values} @item{@reading[read-csv-file (listof (listof any/c))]{a list of lists of comma-separated values}

View File

@ -1,3 +1,4 @@
hello world hello world
good bye good bye
i am done i am done