generic-write is a procedure that transforms a Scheme data value
(or Scheme program expression) into its textual representation and
prints it. The interface to the procedure is sufficiently general to
easily implement other useful formatting procedures such as pretty
printing, output to a string and truncated output.
- Scheme data value to transform.
- Boolean, controls whether characters and strings are quoted.
- Extended boolean, selects format:
- single line format
- integer > 0
- pretty-print (value = max nb of chars per line)
- Procedure of 1 argument of string type, called repeatedly with successive substrings of the textual representation. This procedure can return
#fto stop the transformation.
The value returned by
Examples:(write obj) == (generic-write obj #f #f display-string) (display obj) == (generic-write obj #t #f display-string)
wheredisplay-string == (lambda (s) (for-each write-char (string->list s)) #t)