Philip McGrath schreef op vr 17-06-2022 om 08:42 [-0400]: > I think the problem goes deeper than that: an R6RS string is a fixed- > length sequence of Unicode scalar values, but a path on a Unix-like > system is a sequence of non-null bytes, That's one of the possibilities I know about. Treating that case as ‘ISO-88591-1’ would be sufficient for Guix, albeit conceptually incorrect. > and on Windows is a sequence of UTF-16 code units > with possibly unpaired surrogates (aka WTF-16 [1]). > That is, there are some > valid paths that can not be represented as Scheme strings. Nasty. Didn't know about that. I'll skip that one for now though (I don't think Guile uses the right Windows APIs for that, it just calls 'open' and 'stat' and the like). > Racket has a really nice path datatype that handles these subtleties > (there are many bad headaches if you want to be portable to Windows) > while allowing an ergonomic use of strings for the common case. [2] For now(later), I'll just stick to support overriding the file name encoding, a proper separate path datatype can be added later. E.g., open-file can be changed to support both filenames as strings (to be encoded by the file name encoding) or as an instance of the path datatype. Except for rebase conflicts, this seems rather orthogonal to me. Greetings, Maxime.