((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/csv-xml" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "csv-xml" (toc)) (section 2 "Documentation" (p "A CHICKEN version of \"csv-scheme\". Some additions/extensions to the original.") (section 3 "Input" (p "See " (link "http://www.neilvandyke.org/csv-scheme/" "csv-scheme") " for the full documentation.") (section 4 "csv-reader?" (def (sig (procedure "(csv-reader? OBJECT) => boolean" (id csv-reader?))) (p "Is the " (tt "OBJECT") " a " (tt "csv-reader") "?"))) (section 4 "check-csv-reader" (def (sig (procedure "(check-csv-reader LOC OBJECT [ARG-NAME]) => csv-reader-procedure" (id check-csv-reader))))) (section 4 "error-csv-reader" (def (sig (procedure "(error-csv-reader LOC OBJECT [ARG-MESSAGE []])" (id error-csv-reader))))) (section 4 "reader-spec" (def (sig (procedure "(reader-spec [(newline-type: NEWLINE-TYPE 'lax) (separator-chars: SEPARATOR-CHARS '(#\\,)) (quote-char: QUOTE-CHAR #\\\") (comment-chars: COMMENT-CHARS '()) (quote-doubling-escapes?: QUOTE-DOUBLING-ESCAPES? #t) (whitespace-chars: WHITESPACE-CHARS '(#\\space)) (strip-leading-whitespace?: STRIP-LEADING-WHITESPACE? #f) (strip-trailing-whitespace?: STRIP-TRAILING-WHITESPACE? #f) (newlines-in-quotes?: NEWLINES-IN-QUOTES? #t)]) => csv-reader-spec" (id reader-spec))))) (section 4 "csv-reader-spec?" (def (sig (procedure "(csv-reader-spec? OBJECT) => boolean" (id csv-reader-spec?))) (p "Is the " (tt "OBJECT") " a " (tt "csv-reader-spec") "?"))) (section 4 "check-csv-reader-spec" (def (sig (procedure "(check-csv-reader-spec LOC OBJECT [ARG-NAME]) => csv-reader-spec" (id check-csv-reader-spec))))) (section 4 "error-csv-reader-spec" (def (sig (procedure "(error-csv-reader-spec LOC OBJECT [ARG-MESSAGE []])" (id error-csv-reader-spec)))))) (section 3 "Output" (section 4 "make-csv-writer-maker" (def (sig (procedure "(make-csv-writer-maker [WRITER-SPEC]) =>  (#!optional csv-writer-spec -> ((or output-port string) -> (* -> undefined)))" (id make-csv-writer-maker))) (p "See " (tt "writer-spec") " below for the default " (tt "WRITER-SPEC") "."))) (section 4 "make-csv-writer" (def (sig (procedure "(make-csv-writer OUT-OR-STR [WRITER-SPEC]) => (* -> undefined)" (id make-csv-writer))) (p "Returns a " (tt "procedure") " of 1 argument, a " (tt "scheme-object") ", the " (tt "ROW-DATA-OBJECT") ".") (p (tt "OUT-OR-STR") " is " (tt "output-port") " or " (tt "string") ". A " (tt "string") " is interpreted as a " (tt "pathname") " to yield an " (tt "output-port") ".") (p "See " (tt "writer-spec") " below for the default " (tt "WRITER-SPEC") ".") (p "When the " (tt "ROW-DATA-OBJECT") " is a " (tt "list") " then it is interpreted as row data. Otherwise assumed to be a comment.") (p "The " (tt "ROW-DATA-OBJECT") " argument will be converted to an output " (tt "string") ", according to the associated " (tt "csv-writer-spec") ", and printed to the associated " (tt "output-port") "."))) (section 4 "csv-writer?" (def (sig (procedure "(csv-writer? OBJECT) => boolean" (id csv-writer?))) (p "Is the " (tt "OBJECT") " a " (tt "csv-writer") "?"))) (section 4 "check-csv-writer" (def (sig (procedure "(check-csv-writer LOC OBJECT [ARG-NAME]) => csv-writer-procedure" (id check-csv-writer))))) (section 4 "error-csv-writer" (def (sig (procedure "(error-csv-writer LOC OBJECT [ARG-MESSAGE []])" (id error-csv-writer))))) (section 4 "writer-spec" (def (sig (procedure "(writer-spec [(newline-char: NEWLINE-CHAR #t) (separator-char: SEPARATOR-CHAR #\\,) (quote-char: QUOTE-CHAR #\\\") (comment-char: COMMENT-CHAR #\\#) (quote-doubling-escapes?: QUOTE-DOUBLING-ESCAPES? #t) (quote-controls?: QUOTE-CONTROLS? #t) (always-quote?: ALWAYS-QUOTE? #t)]) => csv-writer-spec" (id writer-spec))) (p (tt "NEWLINE-CHAR") " is " (tt "#t") ", " (tt "cr") ", " (tt "lf") ", or " (tt "crlf") ".") (p (tt "COMMENT-CHAR") " is " (tt "#f") ", or a " (tt "character") ". " (tt "#f") " means no comment support.") (p (tt "QUOTE-DOUBLING-ESCAPES?") " is a " (tt "boolean") ".") (p (tt "QUOTE-CONTROLS?") " is a " (tt "boolean") ", quoting strings with iso-control characters?") (p (tt "ALWAYS-QUOTE?") " is a " (tt "boolean") "."))) (section 4 "csv-writer-spec?" (def (sig (procedure "(csv-writer-spec? OBJECT) => boolean" (id csv-writer-spec?))) (p "Is the " (tt "OBJECT") " a " (tt "csv-writer-spec") "?"))) (section 4 "check-csv-writer-spec" (def (sig (procedure "(check-csv-writer-spec LOC OBJECT [ARG-NAME]) => csv-writer-spec" (id check-csv-writer-spec))))) (section 4 "error-csv-writer-spec" (def (sig (procedure "(error-csv-writer-spec LOC OBJECT [ARG-MESSAGE []])" (id error-csv-writer-spec))))) (section 4 "list->csv" (def (sig (procedure "(list->csv LS [WRITER-OR-OUT])" (id list->csv))) (p (tt "LS") " is a " (tt "list-of list | string") ", a list of row-item.") (p (tt "WRITER-OR-OUT") " is a " (tt "csv-writer") " or " (tt "output-port") ". Default is the " (tt "(current-output-port)") ". Note that when an " (tt "output-port") " is specified the default " (tt "csv-writer-spec") " will be used.") (p "When the current row-item is a " (tt "string") ", and not a " (tt "list") ", then it is treated as a line-comment. Note that comments are processed only when the associated " (tt "csv-writer-spec") " " (tt "comment-char") " is a " (tt "character") ".") (highlight scheme ";assumes string output & comment-char is #\\#\n(list->csv '((1 22 333) \"a comment\" (11 2222 333333)))\n;=> \"\\\"1\\\",\\\"22\\\",\\\"333\\\"\\n#a comment\\n\\\"11\\\",\\\"2222\\\",\\\"333333\\\"\\n\""))))) (section 2 "Usage" (highlight scheme "(require-extension csv-xml)")) (section 2 "Author" (p "Neil van Dyke") (p (int-link "kon lovett" "Kon Lovett") " for CHICKEN")) (section 2 "Bugs & Limitations" (ul (li "The " (tt "quote-doubling-escapes?") " and " (tt "quote-controls?") " are currently ignored by " (tt "csv-writer") "."))) (section 2 "Version history" (dl (dt "0.12.1") (dt "0.12.0") (dd "Use " (tt "quote-doubling-escapes?") " and " (tt "quote-controls?") ". Add " (tt "always-quote?") ".") (dt "0.11.1") (dd "Fix " (tt "writer-spec") " defaults.") (dt "0.11.0") (dd "Add " (tt "reader-spec") ", " (i "csv-out") " stuff.") (dt "0.10.2") (dd "Escape character, '\\', in quoted strings.") (dt "0.10.1") (dt "0.10.0") (dd "Release of csv:0.10 for Chicken"))) (section 2 "License" (p (link "http://www.gnu.org/licenses/lgpl.html" "LGPL 3"))))