Christophe Rhodes <csr21@...> writes:
> Peter Seibel <peter@...> writes:
>> It seems that with 0.8.20 with :sb-unicode enabled (as it is by
>> default) that namestrings are SIMPLE-BASE-STRINGs rather than
>> SB-KERNEL::SIMPLE-CHARACTER-STRINGs and consequently not readably
>> printable. I'm not sure I can make a case that it's non-conformant but
>> it certainly violates the principle of least astonishment for me.
> I think there are a number of issues involved in dealing with
> namestrings. The first, most obvious problem, lies in translating the
> bits on a filesystem corresponding to a file's name into a string:
> what encoding are the bits in? These days, there's a moderate chance
> that it's UTF-8, on Linux and Mac OS; the chance gets slimmer the
> further away from these we go... what is the typical encoding used on
> Solaris? Tru64?
> So I would say that dealing with namestrings currently has
> experimental status, and so yes, you might see some warts: the
> decision to make namestrings SIMPLE-BASE-STRINGs was made by me to see
> who would complain (and implicitly volunteer to at least think about a
> solution to these issues :-).
> In other words, I throw up my hands into the air and acknowledge that
> I don't know what is the right thing to do, and am willing to listen
> to suggestions.
So, a fix to part of the problem--said fix possibly being itself
non-conformant--would be to allow SIMPLE-BASE-STRINGs to be printed
readably using the normal "..." syntax. I realize that this probably
means when they read back in they would be read as
SIMPLE-CHARACTER-STRINGs which may violate the requirement of
similarity. But it seems quite odd to me to have strings that can't be
Or, what really bad thing happens if you just make NAMESTRING return a
SIMPLE-CHARACTER-STRING? Don't change anything about the
encoding/decoding of file names--assume they're ASCII or UTF-8 or
whatever you want--as long as its consistent one can at least use the
namestrings of the pathnames returned by functions such as DIRECTORY
as you'd expect in most regards (with the possible caveat that the
individual characters might not be exactly what you'd expect.) That
is, you can print them, read them back, and use them to get back to a
pathname for the file.
Peter Seibel peter@...
Lisp is the red pill. -- John Fraser, comp.lang.lisp