Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (10 Dec 2021 07:26 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Jakub T. Jankiewicz (10 Dec 2021 10:20 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (10 Dec 2021 13:02 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (10 Dec 2021 13:07 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (10 Dec 2021 22:12 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Daphne Preston-Kendal (17 Feb 2022 13:17 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (17 Feb 2022 13:40 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Daphne Preston-Kendal (20 Feb 2022 08:25 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (20 Feb 2022 15:05 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (25 Feb 2022 07:29 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (25 Feb 2022 17:24 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (21 Feb 2022 18:10 UTC)
Re: NUL-terminated strings and eof-object-terminated generators Marc Nieper-Wißkirchen (22 Feb 2022 08:13 UTC)

Re: NUL-terminated strings and eof-object-terminated generators Jakub T. Jankiewicz 10 Dec 2021 10:20 UTC


On Fri, 10 Dec 2021 08:26:09 +0100
Marc Nieper-Wißkirchen <xxxxxx@gmail.com> wrote:

> If a "string" means a piece of text, then excluding the NUL character is
> reasonable. On the other hand, if "string" means a sequence of (Unicode)
> characters, the NUL character must be allowed. An R6RS "string" conforms to
> the latter interpretation, while an R7RS "string" conforms to the former
> interpretation. Both semantic interpretations are valid. Choosing one has
> implications for interoperability, of course. R6RS can use its strings for
> data transmission in its interface for custom textual ports, R7RS cannot in
> general unless its textual files do not contain the NUL character by
> definition.

Does something like this doesn't work the same in every implementation?

  (string-append "yyyy" (string #\null) "xxxx")

I was testing in Gauche, Chicken, Kawa, Gambit, Guile. They all return the
same output but null have different representation when printed, depending on
the implementation.

Are there any case (or implementation) when Scheme would return "yyyy"?
Or this is not how you create null terminated string in Scheme?

--
Jakub T. Jankiewicz, Web Developer
https://jcubic.pl/me