make read-csv-file/rows available in BSL; closes PR 13542

This commit is contained in:
Matthias Felleisen 2013-02-22 12:35:45 -05:00
parent 09f9f31213
commit 200c20967d
4 changed files with 16 additions and 6 deletions

View File

@ -53,18 +53,20 @@
;; -- f must be formated as a a file with comma-separated values (Any)
;; read the specified file as a list of lists---one per line---of values (Any)
read-csv-file/rows ;; String ([Listof Any] -> X) -> [Listof X]
;; -- f must be formated as a a file with comma-separated values (Any)
;; read the specified file as a file of comma-separated values, apply the second
;; argument to each row, i.e., list of CSV on one line
write-file ;; String String -> String
;; (write-file filename str) writes str to filename;
;; produces the file name as a confirmation that the write succeeded
;; *input-devives*: symbols that redirect input from an input-port
;; *output-devives*: symbols that redirect output from a output-port
)
)
(provide-higher-order-primitive
read-csv-file/rows (_ row-processor) ;; String ([Listof Any] -> X) -> [Listof X]
;; -- f must be formated as a a file with comma-separated values (Any)
;; read the specified file as a file of comma-separated values, apply the second
;; argument to each row, i.e., list of CSV on one line
)
;; -----------------------------------------------------------------------------

View File

@ -0,0 +1,6 @@
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname read-with-csv-ho) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require 2htdp/batch-io)
(check-expect (read-csv-file/rows "batch-io-csv-ho.rktl" length) (cons 3 empty))

View File

@ -0,0 +1 @@
a,b,c

View File

@ -17,6 +17,7 @@ run error-in-draw.rkt
run -t batch-io.rkt
run -t batch-io2.rkt
run -t batch-io3.rkt
run -t batch-io-csv-ho.rkt
run clause-once.rkt
run full-scene-visible.rkt
run image-too-large.rkt