On Tue, Aug 17, 2021 at 4:49 PM Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:
However, what I wonder is why (string? obj) returns false if (text? obj) returns true.   RnRS already has immutable strings, and string? already works on both mutable and immutable strings.

Good point. It seems that we would otherwise have three types of objects.  Mutable strings, immutable strings, and texts.

Texts have no mutators of their own, and while it's possible that an R7RS implementation's string-set! works on texts, it's also possible that it works on pairs: a reasonable implementation will not permit the mutation of texts, just as a reasonable R6RS implementation will support inexact numbers other than 0.0.  Mutating string literals and the results of symbol->string, command-line, environment-variable, and environment-variables may or may not work in a given implementation.

In the 135bis implementation I'm working on, istring? returns #f for all other Scheme strings, #t for istrings (the new name for texts), and either #t or #f for the five cases above, depending on the implementation.