Aziz wrote:
> This may be obvious to you, but I'm having a hard time figuring
> this out.
All too little of the R6RS is obvious to me. This
is not one of the obvious bits.
> How does this work exactly?
>
> (dotest (teststring #\" #\linefeed #\return #\return #\linefeed
> #\x85 #\return #\x85 #\x2028 #\")
> (list (teststring #\linefeed #\linefeed #\linefeed
> #\linefeed #\linefeed #\linefeed)))
>
> Basically, you're doing (open-string-input-port s) which
> "returns a textual input port ... may or may not have a
> transcoder ... if it does, the transcoder is implementation
> dependent"
>
> Where did you say in your code that the eols should turn to
> linefeeds? Isn't an implementation allowed to use an eol-
> style of "none" in their implementation-dependent transcoder
> for textual ports opened with open-string-input-port?
The code doesn't have to say it, because R6RS 4.2.2 says
In a string literal, a <line ending> not preceded by
a \ stands for a linefeed character, which is the
standard line-ending character of Scheme.
The first call to teststring returns
"\"\n\r\r\n\x85;\r\x85;\x2028;\""
The dotest procedure turns that string into a string port
from which a string literal will be read by get-datum.
The characters of that string literal consist of six
consecutive <line ending>s that are not preceeded by a \.
According to R6RS 4.2.2, get-datum must return a string
consisting of six consecutive linefeeds.
Will
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss