Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 18:51 UTC)
Re: Finalizing SRFI 243: Unreadable Data Marc Nieper-Wißkirchen (13 Jun 2023 19:35 UTC)
Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 19:59 UTC)
Re: Finalizing SRFI 243: Unreadable Data Marc Nieper-Wißkirchen (15 Jun 2023 14:43 UTC)
Re: Finalizing SRFI 243: Unreadable Data Daphne Preston-Kendal (13 Jun 2023 20:11 UTC)
Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 20:37 UTC)
Re: Finalizing SRFI 243: Unreadable Data Marc Nieper-Wißkirchen (13 Jun 2023 20:57 UTC)
Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 21:17 UTC)
Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 21:32 UTC)
Re: Finalizing SRFI 243: Unreadable Data Marc Nieper-Wißkirchen (14 Jun 2023 06:06 UTC)
Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela (13 Jun 2023 21:00 UTC)
Re: Finalizing SRFI 243: Unreadable Data Marc Nieper-Wißkirchen (14 Jun 2023 16:18 UTC)

Re: Finalizing SRFI 243: Unreadable Data Lassi Kortela 13 Jun 2023 21:17 UTC

> The principal domain of the write procedure are datum objects, which
> possess a written representation. As long as one does not use write
> outside this domain, nothing is inconsistent and write works as
> intended (namely for textual exchange of datum objects).

That's the literal meaning of current editions of RnRS, but Scheme and
Lisp don't stop there. It's clear that all implementations have
unreadable objects and something must be done about writing them.

Raising an exception is one possibility, but that would be a pain in the
REPL.

> What is the precise definition of "self-consistent"?

I'm not aware of a precise definition. "Read-write invariance" comes
close, but unreadable objects cannot have that property.

For example (write '("one" "two")) will output:

("one" "two")

whereas (display '("one" "two")) will output:

(one two)

The `write` representation consistently mirrors the structure of the
object it was told to write. But the `display` representation is
inconsistent with the original object: what was one string now looks to
`read` like two symbols.

`display` is explicitly designed to act like that, but `write` is
intended to produce structurally consistent lexical syntax. If `write`
produces something like #<a b c> it looks like the three symbols `a` `b`
and `c>`. That interpretation doesn't match the input (which was
intended to be the three symbols a b c), even if the reader is aware of
the `#<` prefix.