I'm concerned about this.  I've added some language to clarify things, but I don't know how we should apply it.  It's just editorial, but we are finalized.

Arthur, what's your take?  The update is at the johnwcowan/srfi-186 repo.

On Tue, Jun 9, 2020 at 4:18 PM Jim Rees <xxxxxx@gmail.com> wrote:
I regret I only started looking at this document today, but curious what the disposition on line-ending styles really is supposed to be.

From the SRFI document:

"An end-of-line style is a symbol that describes how a textual port transcodes representations of line endings. The symbols lf and none mean that no newline conversion is done. The symbol crlf means that after decoding with a codec, the sequence CRLF, that is, a #\return followed by a #\newline, is replaced by #\newline. Correspondingly, the reverse is done before encoding. Implementations may support additional symbols."

This description is inconsistent with the description in r6rs-lib/8.2.4, and with the behavior of chez, racket and guile.    I was not able to easily id not test any other implementations.

From r6rs-lib:
"For a textual input port, any eol-style symbol other than none means that all of the above line-ending encodings are recognized and are translated into a single linefeed."

Guile performs no input transformation no matter what the provided eol style is, so it's not a good example.   Chez & Racket seem to be consistent with the r6rs spec -- ie. they transform all of the line-ending styles when the given style is not none.

Sample code used:
#!r6rs
(import (rnrs))
(define B (string->utf8 "lf\ncrlf\r\ncr\rlfcr\n\r"))
(for-each
 (lambda (es)
   (write es)
   (write-char #\tab)
   (write (bytevector->string B (make-transcoder (utf-8-codec) es)))
   (newline))
 (list
  (eol-style none)
  (eol-style lf)
  (eol-style cr)
  (eol-style crlf)
  (eol-style nel)))
;; Expected output per R6RS standard:
;;
;; none    "lf\ncrlf\r\ncr\rlfcr\n\r"
;; lf      "lf\ncrlf\ncr\nlfcr\n\n"
;; cr      "lf\ncrlf\ncr\nlfcr\n\n"
;; crlf    "lf\ncrlf\ncr\nlfcr\n\n"
;; nel     "lf\ncrlf\ncr\nlfcr\n\n"
;;


On Mon, Mar 9, 2020 at 2:50 PM Arthur A. Gleckler <xxxxxx@speechcode.com> wrote:
Scheme Request for Implementation 186,
"Transcoders and transcoded ports,"
by John Cowan,
is now available for discussion.

Its draft and an archive of the ongoing discussion are available at https://srfi.schemers.org/srfi-186/.

You can join the discussion of the draft by filling out the subscription form on that page.

You can contribute a message to the discussion by sending it to xxxxxx@srfi.schemers.org.

Here's the abstract:

This is an extract from the R6RS that documents its support for transcoders and transcoded ports.  These provide a hook into the Scheme port system from below, allowing the creation of textual ports that provide non-default encoding and decoding from arbitrary binary ports.  It has been lightly edited to fit R7RS style.

Regards,


SRFI Editor