Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/csv-xml|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[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]] == csv-xml [[toc:]] == Documentation A CHICKEN version of "csv-scheme". Some additions/extensions to the original. === Input See [[http://www.neilvandyke.org/csv-scheme/|csv-scheme]] for the full documentation. ==== csv-reader? <procedure>(csv-reader? OBJECT) => boolean</procedure> Is the {{OBJECT}} a {{csv-reader}}? ==== check-csv-reader <procedure>(check-csv-reader LOC OBJECT [ARG-NAME]) => csv-reader-procedure</procedure> ==== error-csv-reader <procedure>(error-csv-reader LOC OBJECT [ARG-MESSAGE []])</procedure> ==== reader-spec <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</procedure> ==== csv-reader-spec? <procedure>(csv-reader-spec? OBJECT) => boolean</procedure> Is the {{OBJECT}} a {{csv-reader-spec}}? ==== check-csv-reader-spec <procedure>(check-csv-reader-spec LOC OBJECT [ARG-NAME]) => csv-reader-spec</procedure> ==== error-csv-reader-spec <procedure>(error-csv-reader-spec LOC OBJECT [ARG-MESSAGE []])</procedure> === Output ==== make-csv-writer-maker <procedure>(make-csv-writer-maker [WRITER-SPEC]) => (#!optional csv-writer-spec -> ((or output-port string) -> (* -> undefined)))</procedure> See {{writer-spec}} below for the default {{WRITER-SPEC}}. ==== make-csv-writer <procedure>(make-csv-writer OUT-OR-STR [WRITER-SPEC]) => (* -> undefined)</procedure> Returns a {{procedure}} of 1 argument, a {{scheme-object}}, the {{ROW-DATA-OBJECT}}. {{OUT-OR-STR}} is {{output-port}} or {{string}}. A {{string}} is interpreted as a {{pathname}} to yield an {{output-port}}. See {{writer-spec}} below for the default {{WRITER-SPEC}}. When the {{ROW-DATA-OBJECT}} is a {{list}} then it is interpreted as row data. Otherwise assumed to be a comment. The {{ROW-DATA-OBJECT}} argument will be converted to an output {{string}}, according to the associated {{csv-writer-spec}}, and printed to the associated {{output-port}}. ==== csv-writer? <procedure>(csv-writer? OBJECT) => boolean</procedure> Is the {{OBJECT}} a {{csv-writer}}? ==== check-csv-writer <procedure>(check-csv-writer LOC OBJECT [ARG-NAME]) => csv-writer-procedure</procedure> ==== error-csv-writer <procedure>(error-csv-writer LOC OBJECT [ARG-MESSAGE []])</procedure> ==== writer-spec <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</procedure> {{NEWLINE-CHAR}} is {{#t}}, {{cr}}, {{lf}}, or {{crlf}}. {{COMMENT-CHAR}} is {{#f}}, or a {{character}}. {{#f}} means no comment support. {{QUOTE-DOUBLING-ESCAPES?}} is a {{boolean}}. {{QUOTE-CONTROLS?}} is a {{boolean}}, quoting strings with iso-control characters? {{ALWAYS-QUOTE?}} is a {{boolean}}. ==== csv-writer-spec? <procedure>(csv-writer-spec? OBJECT) => boolean</procedure> Is the {{OBJECT}} a {{csv-writer-spec}}? ==== check-csv-writer-spec <procedure>(check-csv-writer-spec LOC OBJECT [ARG-NAME]) => csv-writer-spec</procedure> ==== error-csv-writer-spec <procedure>(error-csv-writer-spec LOC OBJECT [ARG-MESSAGE []])</procedure> ==== list->csv <procedure>(list->csv LS [WRITER-OR-OUT])</procedure> {{LS}} is a {{list-of list | string}}, a list of row-item. {{WRITER-OR-OUT}} is a {{csv-writer}} or {{output-port}}. Default is the {{(current-output-port)}}. Note that when an {{output-port}} is specified the default {{csv-writer-spec}} will be used. When the current row-item is a {{string}}, and not a {{list}}, then it is treated as a line-comment. Note that comments are processed only when the associated {{csv-writer-spec}} {{comment-char}} is a {{character}}. <enscript language=scheme> ;assumes string output & comment-char is #\# (list->csv '((1 22 333) "a comment" (11 2222 333333))) ;=> "\"1\",\"22\",\"333\"\n#a comment\n\"11\",\"2222\",\"333333\"\n" </enscript> == Usage <enscript language=scheme> (require-extension csv-xml) </enscript> == Author Neil van Dyke [[kon lovett|Kon Lovett]] for CHICKEN == Bugs & Limitations * The {{quote-doubling-escapes?}} and {{quote-controls?}} are currently ignored by {{csv-writer}}. == Version history ; 0.12.1 : ; 0.12.0 : Use {{quote-doubling-escapes?}} and {{quote-controls?}}. Add {{always-quote?}}. ; 0.11.1 : Fix {{writer-spec}} defaults. ; 0.11.0 : Add {{reader-spec}}, ''csv-out'' stuff. ; 0.10.2 : Escape character, '\', in quoted strings. ; 0.10.1 : ; 0.10.0 : Release of csv:0.10 for Chicken == License [[http://www.gnu.org/licenses/lgpl.html|LGPL 3]]
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 6 by 0?