Requests for comments -- raw strings and WRITE
Peter McGoron 08 Mar 2026 17:31 UTC
Members of WG2 for standardizing R7RS-large voted to incorporate SRFI
267's raw string syntax. Some members indicated their preference for the
WRITE procedure to be allowed to write raw strings.
If this were adopted, the specification would have the additional line:
> Implementations are allowed to output a raw string when WRITE is used
to output a string, as long as reading that string with READ will result
in the a string that is EQUAL? to the original string.
I discovered after the meeting that this would be an incompatibility
with R7RS-Small:
> [WRITE] writes a representation of obj to the given textual output
port. Strings that appear in the written representation are enclosed in
quotation marks, and within those strings backslash and quotation mark
characters are escaped by backslashes. [...]
This wording goes all the way back to the R2RS. Oddly enough, R6RS is
more flexible here and would allow my proposed behavior.
I am leaning towards having the SRFI be silent on this. But I would like
to hear other's opinions.
-- Peter McGoron